skip to Main Content

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.

2

Answers


  1. 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.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search