Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

onTokenRefresh not getting called in signed APK, if previous version of app installed doesn't have FCM implemented

I have implemented FCM in version 6 of my Android application. onTokenRefresh() is getting called if my app is not previously installed. But when my app with a previous version (which did not have FCM implemeted) is already installed and I update it with version 6, then the onTokenRefresh() is not getting called.

Do I need to uninstall the previous app version from Play Store and then install new version?

like image 435
Dharmita bhatt Avatar asked Sep 22 '16 07:09

Dharmita bhatt


1 Answers

I think that should still be the intended behavior. onTokenRefresh() will be called the first time the app is installed. Not every time it's updated. So maybe, you could manually force the onTokenRefresh() like what is mentioned in this post:

If you would like to manually force the onTokenRefresh(), you can create an IntentService and delete the token instance. Then, when you call getToken, the onTokenRefresh() method will be called again.

like image 124
AL. Avatar answered Nov 07 '22 03:11

AL.