【发布时间】:2018-09-24 06:19:09
【问题描述】:
我不确定如何在iOS 上使用FCM 和Flutter 接收数据消息。
为了让您快速了解我的立场,我可以在我的iOS 设备上接收push notifications。所以我已经正确配置了一切(或者我相信)。
因此,当应用程序在后台运行时,我会在通知托盘中收到通知。
当应用程序在前台时,我也在 onMessage 回调中收到消息。
但是,当我尝试通过HTTP 向https://fcm.googleapis.com/fcm/send 请求模拟数据消息并发送正文时:
{
"to" : MY_FIREBASE_TOKEN,
"collapse_key" : "type_a",
"data" : {
"firstKey" : "firstValue",
"secondKey": "secondValue"
}
}
它根本没有出现在我的 onMessage 上。
我在Xcode 项目功能上启用了推送通知。
我还在同一个Xcode 项目功能选项卡中启用了Background Modes 中的Remote Notifications。
我不确定我错过了哪一部分,因为我根本无法接收数据消息。
我也尝试过模拟向dart plugin page中的示例项目发送数据消息,但无济于事。
【问题讨论】:
标签: ios push-notification dart firebase-cloud-messaging flutter