3
votes

I've been using GCM service to send notification to my existing App, in PHP server, as per https://stackoverflow.com/a/11253231/3286489.

Now I'm thinking of migrating to FCM. As per noted https://stackoverflow.com/a/37517339/3286489, the notification service URL "https://android.googleapis.com/gcm/send" has been changed to "https://fcm.googleapis.com/fcm/send"

As I'm still newly explore the FCM, I hope my question is not dump. I have two questions here.

1.) Once migrated to FCM in my client, can I still use back the same PHP code that send my GCM as per https://stackoverflow.com/a/11253231/3286489? Or could I just change the API URL (to fcm.googleapis.com) but retain all PHP code the same? (i.e. is 'https://fcm.googleapis.com/fcm/send' backward compatible with 'https://android.googleapis.com/gcm/send'?)

2.) Upon migrated to FCM (on the server push), and even when after I have upgraded my App to use FCM instead of GCM, I believe there will still be some user that's stick to the older App for a while using GCM. When I send push notification out, do I need to send to both FCM and GCM separately (i.e. I need to keep the old GCM server code for a while)? or I just need to send the FCM, and my old App (with only GCM) will still receive it?

I hope the answer is yes for both, but feel like not likely it's yes. So write to confirm my understanding.

1
Have you seen the migration guide?Waclock
Yes, I have read that, and use that to migrate my GCM. I didn't find anything on the Server side of code though.Elye

1 Answers

3
votes

The answer to both is Yes.

For #1, my post that you linked pretty much answers it. So just to confirm, using the FCM endpoint to send towards your GCM users should be fine. It's still compatible.

For #2, no need to send separate payload for GCM users. As I said above, it is backwards compatible.