简体   繁体   English

FCM和GCM前后兼容吗?

[英]Are FCM and GCM backward and forward compatible?

Google is deprecating Google Cloud messaging in favor of Firebase Cloud Messaging : Google 弃用Google Cloud消息传递 ,而推荐使用 Firebase Cloud Messaging

Firebase Cloud Messaging (FCM) is the new version of GCM. Firebase Cloud Messaging(FCM)是GCM的新版本。 It inherits the reliable and scalable GCM infrastructure, plus new features! 它继承了可靠且可扩展的GCM基础架构以及新功能! See the FAQ to learn more. 请参阅常见问题以了解更多信息。 If you are integrating messaging in a new app, start with FCM. 如果要将消息传递集成到新应用中,请从FCM开始。 GCM users are strongly recommended to upgrade to FCM, in order to benefit from new FCM features today and in the future. 强烈建议GCM用户升级到FCM,以便从现在和将来受益于新的FCM功能。

From some tests I made on my servers, the FCM URL ( https://fcm.googleapis.com/fcm/send ) works with GCM projects, and vice-versa - the GCM URL ( https://android.googleapis.com/gcm/send ) works with FCM projects. 通过我在服务器上进行的一些测试,FCM URL( https://fcm.googleapis.com/fcm/send )可用于GCM项目,反之亦然-GCM URL( https://android.googleapis.com / gcm / send )可用于FCM项目。

Migrating all existing GCM push sending code to FCM would save a lot of trouble and refactoring (I will not have to check, for each push, whether the app version is FCM or GCM). 将所有现有的GCM推送发送代码迁移到FCM可以省去很多麻烦和重构(对于每一次推送,我都不必检查应用程序的版本是FCM还是GCM)。

Is this backward and forward compatibility officially supported or documented? 是否已正式支持或记录了这种向后和向前兼容性?

If you refer to @IanBarber's answer here : 如果您在这里引用@IanBarber的答案:

The tokens are different. 令牌是不同的。 Firebase Cloud Messaging (GCM) use gets registration tokens from the Instance ID API which means you'll get different tokens between that and GCM2. Firebase Cloud Messaging(GCM)的使用从实例ID API获取注册令牌,这意味着您将在该实例和GCM2之间获得不同的令牌。

You'll need to send that new token back to your server to send messages. 您需要将该新令牌发送回服务器以发送消息。 On the server side the APIs should be fully compatible (just new endpoints for FCM) . 在服务器端,API应该完全兼容(只是FCM的新端点)

However, if you're looking for any official documentation, I don't think there is one that explicitly states it. 但是,如果您要查找任何正式文档,我认为没有任何一个明确说明它的文档。 Since as much as possible, Google encourages the use of the corresponding APIs, endpoints, etc. depending on what you really intend to use. Google会尽可能地鼓励您根据自己的实际意图使用相应的API,端点等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM