2

I have application with GCM it's working fine,now i want to migrate from GCM to FCM.

I have used this document for migration,everything working fine for new installed apk.It call the onTokenRefresh and i have used that token for future use.

Issue is

When i update new app(have FCM code) on existing app(have GCM code).it will not call onTokenRefresh method.So how can i upload new token on server for future use when apk is updated not a fresh installed.

In this case i have also tried FirebaseInstanceId.getInstance().getToken(); it but provide a new token but onTokenRefresh not get executed.

Can any one provide a solution for this,how to identify app get updated from GCM to FCM so i will upload new token on server.

MJM
  • 4,870
  • 4
  • 22
  • 49
  • It doesnt execute because the existing tokens still work. See my answer here: https://stackoverflow.com/a/43017737/4625829 – AL. Apr 07 '18 at 09:20
  • @AL. is it means that if i changed URL from https://android.googleapis.com/gcm/send to https://fcm.googleapis.com/fcm/send on server for sent notification still it work for GCM token also? – MJM Apr 07 '18 at 11:20
  • Yes. The FCM API is backwards compatible. – AL. Apr 07 '18 at 12:26

0 Answers0