【问题标题】:Is it possible to send FCM push-notification to the particular application package name through POSTMAN?是否可以通过 POSTMAN 向特定应用程序包名称发送 FCM 推送通知?
【发布时间】:2019-07-20 05:59:07
【问题描述】:

我知道如何通过 POSTMAN 发送带有 FCM-TOKEN 和 TOPIC 名称的推送通知,但是如果我的 firebase 项目包含超过 2 个,我不确定如何发送带有包名称的 FCM 通知或仅发送到特定包已连接的应用程序。

{ 
 "to": "/topics/global", // global is your topic 
 "notification" : {
 "body" : "great match!",
 "content_available" : true,
 "priority" : "high",
 "title" : "Portugal vs. Denmark"
 },
 "data" : {
 "body" : "great match!",
 "content_available" : true,
 "priority" : "high",
 "title" : "Portugal vs. Denmark"
 }
}

【问题讨论】:

    标签: java android firebase push-notification postman


    【解决方案1】:

    是的,您可以从 Postman 发送通知。 为此,您必须创建如下所示的 JSON

    {
     "to" : "YOUR_FCM_TOKEN_WILL_BE_HERE",
     "collapse_key" : "type_a",
     "notification" : {
     "body" : "Body of Your Notification",
     "title": "Title of Your Notification"
    },
    "data" : {
     "body" : "Body of Your Notification in Data",
     "title": "Title of Your Notification in Title",
     "key_1" : "Value for key_1",
     "key_2" : "Value for key_2"
      }
    }
    

    选择POST METHOD 输入请求网址为https://fcm.googleapis.com/fcm/send

    添加标题Authorization: key=<server_key>,您将从 Firebase 云消息选项卡中获取它

    还有Content-Type: application/json

    欲了解更多信息,请查看Link

    希望这会对你有所帮助。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-01-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多