reesaspieces
reesaspieces

Reputation: 1800

Rich notification from FCM does not invoke iOS notification extension (attached image not loading)

I have been trying to send images in my push notifications to iOS devices. My push notifications can be sent without any errors, but the images are not being displayed.

What I have tried so far:

I can:

I can't:

My HTTP request looks like this:

curl --request POST \
  --url https://fcm.googleapis.com/v1/projects/${project_name}/messages:send \
  --header 'Authorization: Bearer ${access token}' \
  --header 'Content-Type: application/json' \
  --data '{
   "message":{
      "token":"token",
      "notification":{
         "title":"test notification title",
         "body":"test notification body",
         "image":"https://image_url"
      },
      "apns":{
         "payload":{
            "aps":{
               "mutable-content":1
            }
         },
         "fcm_options":{
            "image":"https://image_url"
         }
      },
      "data":{
         "some_arbitrary_data":"some_arbitrary_data"
      }
   }
}'

What could I be missing here?

[Update] It seems like the issue is that my notification extension is not being called at all.

Upvotes: 1

Views: 672

Answers (1)

reesaspieces
reesaspieces

Reputation: 1800

It turned out to be because of a custom configuration in our Podfile.

Removed the lines below from our Podfile, and now it works.

target 'Runner' do
  use_modular_headers!
  pod 'Firebase/Core' # Remove this line
  pod 'Firebase/Crashlytics'
  pod 'Firebase/Analytics'
  pod 'Firebase/Messaging' # Remove this line
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

Upvotes: 0

Related Questions