是否可以在 Firebase 上使用 REST API 发送推送通知?我可以使用 Firebase 控制台发送通知,但我需要使用 REST API 发送通知。
最佳答案
只是为了帮助,
如果有人想使用 REST POST API,就在这里,使用具有以下配置的 Postman
网址:
https://fcm.googleapis.com/fcm/send
标题:
"Content-Type": "application/json",
"Authorization": "key=<Server_key>"
body :
{
"to": "<Device FCM token>",
"notification": {
"title": "Check this Mobile (title)",
"body": "Rich Notification testing (body)",
"mutable_content": true,
"sound": "Tri-tone"
},
"data": {
"url": "<url of media image>",
"dl": "<deeplink action on tap of notification>"
}
}
就是这样。谢谢!!!
如果您想了解更多关于 FCM 富通知的详细信息,您可以查看我在 Medium 上的文章 Rich Push Notification with Firebase Cloud Messaging (FCM) and Pusher on iOS platform
关于android - 火力地堡 : Send notification with REST API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37490629/