【发布时间】:2021-05-22 13:33:34
【问题描述】:
我正在将此 json 发送到云消息传递(带有正确的标头)并希望在我的设备上获得通知,但它没有出现在我的手机上。我想也许我缺少 Android 的频道 ID 初始化?
*附加信息
- 如果我发送带有标题或正文的“通知”有效负载,它正在接收,但我不想使用“通知”有效负载。我只想拥有“数据”负载
{
"to" : "my device token",
"mutable_content" : true,
"content_available": true,
"data" : {
"content": {
"id": 100,
"channelKey": "basic_channel",
"title": "Huston!\nThe eagle has landed!",
"body": "A small step for a man, but a giant leap to Flutter's community!",
"notificationLayout": "BigPicture",
"largeIcon": "https://media.fstatic.com/kdNpUx4VBicwDuRBnhBrNmVsaKU=/full-fit-in/290x478/media/artists/avatar/2013/08/neil-i-armstrong_a39978.jpeg",
"bigPicture": "https://www.dw.com/image/49519617_303.jpg",
"showWhen": true,
"autoCancel": true,
"privacy": "Private"
},
"actionButtons": [
{
"key": "REPLY",
"label": "Reply",
"autoCancel": true,
"buttonType": "InputField"
},
{
"key": "ARCHIVE",
"label": "Archive",
"autoCancel": true
}
]
}
}
【问题讨论】:
标签: android firebase flutter firebase-cloud-messaging