Android APP 从 GCM 迁移到 FCM。旧的 GCM 令牌不起作用

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

来自 Google 的文档说:

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

但是当我将我的应用程序更新到 FCM 时。存储在我的服务器中的旧 GCM 令牌不再起作用。当我尝试发送推送消息时,Google 消息服务器响应错误消息,未注册。有人 运行 遇到同样的问题吗?

基于 GCM and FCM FAQ 的文档:

您现有的 GCM 令牌和令牌处理是否仍然有效?

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.