【发布时间】:2017-02-02 13:47:00
【问题描述】:
使用 FCM,当应用处于后台或未运行时,我会在系统托盘中收到推送通知。当应用程序处于前台时,我可以覆盖 onMessageReceived 并使用NotificationCompat 创建我自己的提醒通知。
当我的应用在后台或未运行时,有没有办法创建提醒通知?
谢谢
编辑:这里是我通过 curl 使用的消息有效负载到https://fcm.googleapis.com/fcm/send
{
"to":"push-token",
"content_available": true,
"priority": "high",
"notification": {
"title": "Test",
"body": "Mary sent you a message!",
"sound": "default"
},
"data": {
"message": "Mary sent you a Message!",
"notificationKey":"userID/notification_type",
"priority": "high",
"sound": "default"
}
}
【问题讨论】:
标签: android android-notifications firebase-cloud-messaging heads-up-notifications