简体   繁体   中英

Are FCM and GCM backward and forward compatible?

Google is deprecating Google Cloud messaging in favor of Firebase Cloud Messaging :

Firebase Cloud Messaging (FCM) is the new version of GCM. It inherits the reliable and scalable GCM infrastructure, plus new features! See the FAQ to learn more. If you are integrating messaging in a new app, start with FCM. GCM users are strongly recommended to upgrade to FCM, in order to benefit from new FCM features today and in the future.

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.

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).

Is this backward and forward compatibility officially supported or documented?

If you refer to @IanBarber's answer here :

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.

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) .

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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