GCM to FCM migration should / should I keep the current GCM server side?
I am using the GCM service to send notifications to my existing application on a PHP server at stackoverflow .
Now I'm going to switch to FCM. As noted qaru.site/questions/265171 / ... , the URL notification service " https://android.googleapis.com/gcm/send " was changed to " https://fcm.googleapis.com/fcm/send "
Since I am still recently researching FCM, I hope my question is not a dump. I have two questions here.
1.) After migrating to FCM in my client, can I use the same PHP code that my GCM is submitting according to this StackOverflow question ? Or can I just change the API url (fcm.googleapis.com) but keep all PHP code the same? (i.e. ' https://fcm.googleapis.com/fcm/send ' is backwards compatible with ' https://android.googleapis.com/gcm/send ?)
2.) When migrating to FCM (on the server), and even after using FCM instead of GCM after updating my application, I believe there will still be some user sticking with the old application using GCM for a while. When I send a push notification, do I need to send both FCM and GCM separately (i.e. I need to keep the old GCM server code for a while)? or do I just need to submit FCM and my old app (with GCM only) will still receive it?
I hope the answer is yes for both, but I feel like it is not. So write to confirm my understanding.
source to share
Answer to both: Yes.
For # 1, my post you pretty much answered. So just for confirmation, using an FCM endpoint to send towards your GCM users should be fine. It is still compatible .
For # 2, there is no need to send a separate payload for GCM users. As I said above, it is backward compatible.
source to share