android - 火力地堡 : Send notification with REST API

标签 android rest push-notification firebase

是否可以在 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/

相关文章:

android - C2DM的可靠性

IOS 推送通知在生产环境中不起作用 : fwrite(): SSL: Broken pipe

android - 没有物理按键的Android系统如何使用monkey命令?

wordpress - 验证 WP REST API GET 请求

rest - 如何在 noir 中创建 REST API 来接收 ids 列表?

jquery - 使用 Ajax 的 PUT 请求(处理 Spring)

java - 为 Android 设置解析推送通知

android - 我可以为 Google Play UI 测试定义场景吗?

java - 拆分操作栏不透明

java - android : AssetManager and list() not working 处理