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 badges
Add a comment  | 

2 Answers 2

Reset to default 0

Here 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