>有谁知道我是否需要管理颤振Firebase消息传递示例中的数据id
和status
选项?
我似乎找不到在 https://pub.dev/packages/firebase_messaging 或 https://firebase.google.com/docs/cloud-messaging/concept-options#notification-messages-with-optional-data-payload 提到这一点
Flutter 文档中curl
示例如下所示:
DATA='{"notification": {"body": "this is a body","title": "this is a title"}, "priority": "high", "data": {"click_action": "FLUTTER_NOTIFICATION_CLICK", "id": "1", "status": "done"}, "to": "<FCM TOKEN>"}'
curl https://fcm.googleapis.com/fcm/send -H "Content-Type:application/json" -X POST -d "$DATA" -H "Authorization: key=<FCM SERVER KEY>"
我正在尝试确定是否需要管理后端服务中的id
值和status
值。看起来像,但其他人在这里做什么?
谢谢。
数据字段只是一个任意键值有效负载,id
和status
只是示例,请参阅:https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#Message.FIELDS.data
请注意,提供的 curl 示例使用的是旧版 HTTP 协议。
firebase_messaging传递一个事件在data.click_action
或notification.click_action
"FLUTTER_NOTIFICATION_CLICK"
时颤振,请参阅:https://github.com/flutter/plugins/blob/4f0c5dd2bd30673446a8d511f7a791af9757eb3e/packages/firebase_messaging/android/src/main/java/io/flutter/plugins/firebasemessaging/FirebaseMessagingPlugin.java#L179-L208