问题描述
根据 https://stackoverflow,我一直在使用 GCM 服务在 PHP 服务器中向我现有的应用程序发送通知.com/a/11253231/3286489.
现在我正在考虑迁移到 FCM.根据 https://stackoverflow.com/a/37517339/3286489,通知服务 URLhttps://android.googleapis.com/gcm/send" 已更改为 "https://fcm.googleapis.com/fcm/send"
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"
由于我还是新探索 FCM,我希望我的问题不是转储.我有两个问题.
As I'm still newly explore the FCM, I hope my question is not dump. I have two questions here.
1.) 一旦在我的客户端中迁移到 FCM,我是否仍然可以使用发送 GCM 的相同 PHP 代码,按照 https://stackoverflow.com/a/11253231/3286489?或者我可以只更改 API URL(到 fcm.googleapis.com)但保留所有 PHP 代码吗?(即 'https://fcm.googleapis.com/fcm/send' 向后兼容与'https://android.googleapis.com/gcm/send'?)
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.) 迁移到 FCM 后(在服务器推送上),即使在我升级我的应用程序以使用 FCM 而不是 GCM 之后,我相信仍然会有一些用户坚持使用旧应用程序一段时间使用 GCM.当我发送推送通知时,是否需要分别发送到 FCM 和 GCM(即我需要保留旧的 GCM 服务器代码一段时间)?或者我只需要发送 FCM,我的旧 App(只有 GCM)仍然会收到它?
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,我的 帖子 几乎可以回答它.所以只是为了确认,使用 FCM 端点发送给你的 GCM 用户应该没问题.它仍然兼容.
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.
对于 #2,无需为 GCM 用户发送单独的有效负载.正如我上面所说,它是向后兼容的.
For #2, no need to send separate payload for GCM users. As I said above, it is backwards compatible.
这篇关于将 GCM 迁移到 FCM,我应该/可以保留当前 GCM 服务器端的代码吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!