且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用 FCM 从服务器发送推送通知

更新时间:2023-02-16 22:50:32

服务器端编码有何不同?

由于没有太大区别,您也可以查看 GCM 的大多数示例服务器端代码.GCM 和 FCM 的主要区别在于,在使用 FCM 时,您可以使用它的新功能(如本答案).FCM 还有一个控制台,您可以在其中发送消息/通知,而无需拥有自己的应用服务器.

Since there is not much difference, you can just check out most of the example server-side codes for GCM as well. Main difference with regards to GCM and FCM is that when using FCM, you can use the new features with it (as mentioned in this answer). FCM also has a Console where you can send the Message/Notification from, without having your own app server.

注意:创建自己的应用服务器取决于您.只是说明您可以通过控制台发送消息/通知.

NOTE: Creating your own app server is up to you. Just stating that you can send a message/notification via the console.

使用的 URL 是https://android.googleapis.com/gcm/send".FCM 的等效 URL 是什么?

The URL used is "https://android.googleapis.com/gcm/send". What would be the equivalent URL for FCM?

FCM 的等效 URL 是 https://fcm.googleapis.com/fcm/send.您可以查看此doc了解更多详情.

The equivalent URL for FCM is https://fcm.googleapis.com/fcm/send. You can check out the this doc for more details.

干杯!:D