question

SreejithSree-2948 avatar image
0 Votes"
SreejithSree-2948 asked LeonLu-MSFT edited

Xamarin Forms: Token generating is not working when taking the update

I have implemented the push notification feature for my xamarin forms project (both android and ios). The token registration class FirebaseRegistrationService is working only on the fresh installation. When taking updates this class is not firing and no token is generating. As per this blog, OnTokenRefresh is invoked infrequently: it is used to update the token under the following circumstances:

  • When the app is installed or uninstalled.

  • When the user deletes app data.

  • When the app erases the Instance ID.

  • When the security of the token has been compromised.

My problem is my app is already LIVE on the play store without the push notification. We have implemented the push notification now and planning to update it on play stores. But if the user takes the update the FCM registration will not work for them and they are not going to receive any notification. Existing users need to uninstall the app and install it again for getting the notifications. Is there any solution for this?

But on the ios part, the DidReceiveRegistrationToken is invoking when taking updates, and no such token issue on the ios part.

dotnet-xamarin
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

LeonLu-MSFT avatar image
1 Vote"
LeonLu-MSFT answered LeonLu-MSFT edited

Hello,​

Welcome to our Microsoft Q&A platform!

Normally, we will store the token in the Xamarin.Essentials: Secure Storage on the fresh installation. After updating application, you still get the token from the local secure storage. But now, If you do not store the token in the local storage, existing users have to uninstall the app or delete app data.


Best Regards,

Leon Lu



If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for the confirmation, could you please post it as an answer.

0 Votes 0 ·

I converted my comment to answer.

0 Votes 0 ·