【发布时间】:2018-02-25 12:43:18
【问题描述】:
我一直在尝试使用 FCM 发送推送通知。当应用程序处于前台或后台时,它完全可以工作。但是,如果我从最近的列表中删除该应用程序,那么我不会收到任何通知。
This is my structure of FCM with data payload
{"registration_ids":["here is my FCM token"],
"data":{
"body" :"Hello All, Hope you had a great time!",
"title":"Title",
"click_action":"ACTIVITY_MESSAGE",
"sound":"default",
"type" : "message",
"message": "message_here",
"time" : "2016-12-14 03:37:pm"
}
}
This is the structure with data and notification
{"registration_ids":["Here is my FCM token"],
"notification":{
"body" : "Hello All, Hope you had a great time!",
"title":"title here",
"click_action":"ACTIVITY_HOME",
"sound":"default"
},
"data":{
"type" : "message",
"message": "message_here",
"time" : "2016-12-14 03:37:pm"
}
}
我也对通知标签和数据进行了同样的尝试,但如果应用程序被终止,则没有任何效果。如果有人知道在我的应用程序被杀死的情况下如何获得通知,请分享。
【问题讨论】:
标签: android firebase push-notification firebase-notifications