gpt4 book ai didi

android - Ionic 3 应用程序按预期从 FCM 网络界面接收后台通知,但没有使用 curl

转载 作者:行者123 更新时间:2023-11-30 00:06:17 25 4
gpt4 key购买 nike

我已经包含了来自 Ionic Native 的 FCM,当我从 FCM 网络界面发送消息时,我可以在后台和前台接收通知。它按预期工作。但是,当我 curl 请求时,它仅在应用程序位于前台时有效。有谁知道为什么会这样?我什么都没看到http protocol docs .

这是我要发送的请求。

curl -H "Content-type: application/json" -H "Authorization:key=<fcm server key>"  -X POST -d '{ "data": { "title": "wow", "msg": "hello world"},"to":"<fcm token>"}' https://fcm.googleapis.com/fcm/send

我还尝试模拟来自 FCM 网络界面的网络流量,看看它是否与有效载荷字段有关,但仍然没有成功。

最佳答案

我找到了我要找的东西。为了在应用程序关闭或在后台运行时显示通知,负载中必须存在 notification 对象。对我来说,它还必须有标题或正文字段。

关于android - Ionic 3 应用程序按预期从 FCM 网络界面接收后台通知,但没有使用 curl,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48941775/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com