我正在使用邮递员的 Post 方法向我的 Flutter 应用程序发送通知,如果我以这种方式将正文包含在通知之外,我可以发送通知。
{
"to": "cu6HFvgXSCyKz5kjp..........",
"notification": {
"sound": "default",
"body": "test body",
"title": "test title",
"content_available": true,
"priority": "high"
},
"data": {
"sound": "default",
"body": "test body",
"title": "test title",
"content_available": true,
"priority": "high",
"ride_request_id":"asdfasd"
}
}
我可以解析数据以从 ride_request_id
获取我的值,但问题是我收到了双重通知,因此 FCM 建议在通知中包含正文,现在,我既没有收到通知也无法解析它。尽管在 Postman 中它显示为成功。
{
"to": "cu6HFvgXSCyKz5kjp..........",
"notification": {
"sound": "default",
"body": "test body",
"title": "test title",
"content_available": true,
"priority": "high",
"data": {
"sound": "default",
"body": "test body",
"title": "test title",
"content_available": true,
"priority": "high",
"ride_request_id": "asdfasd"
}
}
}