簡體   English   中英

是否可以通過POSTMAN向特定的應用程序包名稱發送FCM推送通知?

[英]Is it possible to send FCM push-notification to the particular application package name through POSTMAN?

我知道如何通過POSTMAN發送帶有FCM-TOKEN和TOPIC名稱的推送通知,但是我不確定如何在我的Firebase項目包含兩個以上連接的應用程序的情況下,以包名稱發送FCM通知,或者僅向特定包發送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"
 }
}

是的,您可以從郵遞員發送通知。 為此,您必須創建一個如下所示的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輸入請求URL作為https://fcm.googleapis.com/fcm/send

添加標頭Authorization: key=<server_key> ,您將從Firebase Cloud消息傳遞選項卡獲取它

Content-Type: application/json

有關更多信息,請檢查此鏈接

希望這會幫助你。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM