Android APP migrates from GCM to FCM. Old GCM tokens do not work

£可爱£侵袭症+ 提交于 2019-12-11 14:23:36

问题


The document from Google says:

GCM tokens retrieved via GoogleCloudMessaging.register() or InstanceID.getToken() will continue to work in FCM without any modification or renewal.

But when I update my APP to FCM. The old GCM token which stores in my Server does not work anymore. When I tried to send a push message, the Google Message server response the error message, not registered. Does anyone ran into the same problem?


回答1:


Based from the documentation of GCM and FCM FAQ:

Will your existing GCM tokens and token handling still work?

Your GCM and FCM registration tokens are mutually interchangeable; you can send to existing GCM tokens through the FCM HTTP server APIs. For GCM and FCM token handling, remember:

  • If you store and send to specific tokens, be sure to implement the token refresh method to ensure your tokens are always up to date
  • iOS devs should avoid calling .getToken(authorizedEntity,scope) unless there is a need to enable multiple senders. Use FirebaseInstanceId.getInstance().getToken() instead.


来源:https://stackoverflow.com/questions/52696687/android-app-migrates-from-gcm-to-fcm-old-gcm-tokens-do-not-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!