【问题标题】:Notification format FCM firebase通知格式 FCM firebase
【发布时间】:2022-06-18 08:50:32
【问题描述】:

我用邮递员测试了推送通知 fcm。当我把我的数据通过

{
 "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"
 }
} 

我收到通知。但是当我将其更改为自定义通知时

{
 "to" : "YOUR_FCM_TOKEN_WILL_BE_HERE",
 "collapse_key" : "type_a",
 "data" : {
     "body" : "Sending Notification Body From Data",
     "title": "Notification Title from Data",
     "key_1" : "Value for key_1",
     "key_2" : "Value for key_2"
 }
}

我不再收到任何通知。有人知道这个问题吗? 我关注这篇文章https://medium.com/android-school/test-fcm-notification-with-postman-f91ba08aacc3

谢谢!!!

【问题讨论】:

    标签: firebase flutter push-notification firebase-cloud-messaging


    【解决方案1】:

    您的第二个语句中缺少此内容,这是必需的:

     "notification" : {
         "body" : "Body of Your Notification",
         "title": "Title of Your Notification"
     },
    

    【讨论】:

      猜你喜欢
      • 2017-05-04
      • 1970-01-01
      • 2022-08-15
      • 2018-04-14
      • 1970-01-01
      • 2016-09-21
      • 1970-01-01
      • 2022-08-22
      • 2018-12-04
      相关资源
      最近更新 更多