admin管理员组文章数量:1122832
I'm implementing push notifications in my Flutter app using Firebase Cloud Messaging (FCM). Everything works well, and I can receive text-based notifications on both Android and iOS. However, I cannot get the image to display in the notification on iOS, even though it works fine on Android.
I'm implementing push notifications in my Flutter app using Firebase Cloud Messaging (FCM). Everything works well, and I can receive text-based notifications on both Android and iOS. However, I cannot get the image to display in the notification on iOS, even though it works fine on Android.
Share Improve this question asked Nov 21, 2024 at 12:35 Rakesh SainiRakesh Saini 7333 gold badges11 silver badges27 bronze badges2 Answers
Reset to default 0Here see if there's anything useful here https://firebase.google.com/docs/cloud-messaging/ios/send-image
Here are some steps and solutions to help resolve this:
Notification payload update:
Make sure your FCM payload includes the mutable-content key set to true. This is required for media attachments on iOS.
{
"to": "<device_token>",
"notification": {
"title": "Title",
"body": "Body",
"mutable_content": true,
"image": "https://example.com/image.png"
},
"data": {
"image": "https://example.com/image.png"
}
}
Service Extension:
On iOS, we need a Notification Service Extension to handle rich media, if not setup already follow Firebase iOS Rich Media Setup step-by-step instructions.
iOS 10+ Requirement:
Images in notifications only work on iOS 10 or later, so make sure your app's Info.plist and deployment target.
本文标签: Not Getting the Image Into Firebase Push Notification IOS For FlutterStack Overflow
版权声明:本文标题:Not Getting the Image Into Firebase Push Notification IOS For Flutter? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736310868a1934531.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论