firebasemessaging.sbackgroundmessage当我的应用在扑面而来时不会调用,仅在iOS设备中发生。
我正在制作一个具有推送通知属性应用程序的应用程序,当我们在前景上点击通知时,但是当应用在后台我的_backgroundHandler()方法时,它仅在iOS应用中才发生
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
还挣扎了这个问题。
设置有效载荷如下。 可变的容器很有意义。
https://github.com/github.com/fire.com/firebase/firebase/flutterfire/flutterfire/sissues/sissues/9381#issuececomment-122222296667020.66666666666670
设置iOS在有效载荷中的“可变容器:1”将通知传递给我们的通知服务应用程序扩展。
有关更多信息APNS有效载荷,请参见以下链接:
https://developer.apple.com/documentation/usernotification/setting_up_a_a_remote_notification_server/generating_a_remote_notification_notification_notification
also struggle this issue.
set payload as below. mutable-content make sense.
https://github.com/firebase/flutterfire/issues/9381#issuecomment-1229167020
set "mutable-content:1" in payloads, iOS passes the notification to our notification service app extension.
For more information APNs payload, see the following links:
https://developer.apple.com/documentation/usernotifications/setting_up_a_remote_notification_server/generating_a_remote_notification
在XCode中启用背景获取,背景处理和远程通知

编辑
添加可变的键
{
“ to”:“ dwdhfjfjdbzbmjj5 ....”,
“ content_available”:是的,
“ mutable_content”:true,
“ data”:
{
“消息”:“一些味精”,
“ MediaUrl”:“在这里图像URL”
},
“通知”:
{
“身体”:“通知味觉”,
“声音”:“默认”
}
}
编辑
Enable background fetch, background processing and remote notification in Xcode

Edit
Add mutable key to payload
{
"to": "dWdhfjfjdbzbmjJ5....",
"content_available": true,
"mutable_content": true,
"data":
{
"message": "some msg",
"mediaUrl": "image url here"
},
"notification":
{
"body": "notification msg",
"sound": "default"
}
}
EDIT
在我的有效载荷中添加此问题解决了我的问题:
Adding this in my payload solved my issue:
我也面临这个问题。
@Goza的答案应该被接受。
这是我的发送JSON。
I have face this issue too.
@goza's answer should been accepted.
This is my sending json.