FCM notification messages not collapsing

限于喜欢 提交于 2020-01-17 05:46:25

问题


I noticed that when i send FCM payload when app is in background, i see the notification message being shown which is as per docs, but i see native notifications for every notification message received. When my app was in the background, i received 3 push messages (with notification payload) and i now see 3 native notifications in the notification tray. Why are they not getting collapsed ? By default, according to FCM docs, all notification messages are collapsible. Reference to the doc: https://firebase.google.com/docs/cloud-messaging/concept-options

I am using compile 'com.google.firebase:firebase-messaging:10.0.0' in my app\build.gradle


回答1:


In this case the "Tag" variable should be used. There should be same Tag set in the notifications payload. The complete notifications payload is as follows and it is working for me.

 "notification":{
    "title":"Huawei",
    "body":"21 Notification received", 
    "sound":"default",
    "badge":4,
    "tag":"1",
    "click_action":"OPEN_ACTIVITY_1"
     "icon":"fcm_push_icon" 
  }


来源:https://stackoverflow.com/questions/40816284/fcm-notification-messages-not-collapsing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!