New FCM id-Token invalid when app is Updated

Hi guys,

After migrating from the old plugin to the new FCM-based plugin, i notice this problem.

When a user updates the app from an old version (which was build using old GCM plugin), to the new updated app (build using new FCM based plugin), the new token-id received (usually after a few app restarts) is invalid and failure reported from FCM.

The old token id (from the older app version) is still valid and works.

But if the user does a new install of the app, then the FCM token-id received is valid.

Tested this on 2 different apps and it showed the same behavior.

Sample of old id : APA91bEa9gcHxFULN2fkBXA3-GtHIYJBI69pa2n9Frdrbzh9vs1bsc8IH4GOFyNgzdWkUbRJvkQlxE0JeebgTtsy52-WzXtNETsdxL1a8OZjnWrA6HoHboQhxQY4mW5pzraKlTZOWLOraY30NLG2pUfD-ZSFirtPug Sample of new id, invalid (FCM) : daBXcevPBxk:APA91bFNgPNbbuXtbK6XP0mz6OMi6gUphe59WyzqeIVEnPIUd5ClwqjhpJu57C2ddvf6zJbnb3UKVwooofDrSZtIoF-7CgH\_kA4DKibViYeREfOGRTXdE3ICaSgxMV2112\_DyYqF\_SrT Sample of new id, valid (FCM) : d1vUBQwKtNs:APA91bFGK6z2M3uioltedZvXjVTELwxrAyZN7nx1whloQLDn4xUPnQsxaootJF4YL8Mt3MgFF2i4C6nx-OlOetfJtNlR3RPfS8fBaSN23mZert4--abDzhoKFFI7epezlBoidt1QJWjn

Can you create a simple test case to demo this issue?

Rob

When I created the sample project, i notice the old and new token id works.

Then I retried the 2 apps in my first post, by installing the old apk files and updating them to the new apk files, the notification token received were now ok (no failure reported by FCM). Not sure what is amiss as the apk files did not change.

Will keep an eye out for this. Sorry for the inconvenience.

Ok. I have kinda figured out what is happening and have filed a bug report. It is mainly due to the ‘config.lua’

In summary, when developer is updating an app from the old-notification-plugin to the new-notification-plugin, the GCM project number must be in the ‘config.lua’  or else the new notification token received is always invalid when the app restarts.

Steps to reproduce :

  1. Install APK that uses the old-notification plugin

  2. Update the code to use new notification plugin, and also REMOVE the GCM project number in ‘config.lua’

  3. Update the old app (using this command  : “adb install -r YOUR_NEW_APP.apk”  )

  4. When the app starts (or maybe after a few app restarts), a new notification-id is received. This new notification-id works until the app is killed/restart.

  5. After that, the app will keep on receiving a new notification-id (maybe after 1 or 2 app-restart) and all these notification-ids will not work anymore.

Anyway, there is a clause with isn’t in the API docs, but only in the guide docs. It says not to update from legacy plugin (GCM) to new plugin (FCM).

Hi @yosu,

I see how this could be confusing. I’ll add the same clause that’s in the guide to the API documentation.

Brent

Dear Brent,

In my case, part of my apps are updated to use the new FCM-notification plugin, while i am in progress of updating some older apps to also use the new FCM-notification plugin (from the old GCM plugin).

Are there any expected issues with updating the old GCM-notification plugin to the new FCM-notification plugin ? 

May I know the reason behind this clause : 

... you should continue using the legacy plugin instead of the current notifications plugin.

Thanks

Can you create a simple test case to demo this issue?

Rob

When I created the sample project, i notice the old and new token id works.

Then I retried the 2 apps in my first post, by installing the old apk files and updating them to the new apk files, the notification token received were now ok (no failure reported by FCM). Not sure what is amiss as the apk files did not change.

Will keep an eye out for this. Sorry for the inconvenience.

Ok. I have kinda figured out what is happening and have filed a bug report. It is mainly due to the ‘config.lua’

In summary, when developer is updating an app from the old-notification-plugin to the new-notification-plugin, the GCM project number must be in the ‘config.lua’  or else the new notification token received is always invalid when the app restarts.

Steps to reproduce :

  1. Install APK that uses the old-notification plugin

  2. Update the code to use new notification plugin, and also REMOVE the GCM project number in ‘config.lua’

  3. Update the old app (using this command  : “adb install -r YOUR_NEW_APP.apk”  )

  4. When the app starts (or maybe after a few app restarts), a new notification-id is received. This new notification-id works until the app is killed/restart.

  5. After that, the app will keep on receiving a new notification-id (maybe after 1 or 2 app-restart) and all these notification-ids will not work anymore.

Anyway, there is a clause with isn’t in the API docs, but only in the guide docs. It says not to update from legacy plugin (GCM) to new plugin (FCM).

Hi @yosu,

I see how this could be confusing. I’ll add the same clause that’s in the guide to the API documentation.

Brent

Dear Brent,

In my case, part of my apps are updated to use the new FCM-notification plugin, while i am in progress of updating some older apps to also use the new FCM-notification plugin (from the old GCM plugin).

Are there any expected issues with updating the old GCM-notification plugin to the new FCM-notification plugin ? 

May I know the reason behind this clause : 

... you should continue using the legacy plugin instead of the current notifications plugin.

Thanks