FCM: Image failed to download to display on Push notification for Android Phones

Viewed 419

I have integrated @react-native-firebase/messaging in React Native app. Push notification is working perfectly but sometimes the image couldn't display on push notification which is sent in the notification payload as like below:

{
    "to": "FCM-TOKEN",
    "notification": {
        "body": "Body Text",
        "title": "Title Text",
        "image": "IMAGE-URL"
    },
    "data": {
        ...
    },
    "priority": "high"
}

All works perfectly but I have found that this issue only in some devices like Samsung, Xiaomi, and which have Android 11 OS. This happens only on Android phones only. For iPhone, it works fine.

And, I am getting the below logs from Firebase:

2021-06-28 12:23:21.504 24846-24916/? I/FirebaseMessaging: Starting download of: <IMAGE-URL>
2021-06-28 12:23:26.553 24846-24914/? W/FirebaseMessaging: Failed to download image in time, showing notification without it

It's a very strange issue, I couldn't able to find any perfect solution for the last few days, and even Google, Android, and React-Native-Firebase haven't mentioned this in any release notes of Firebase.

Let me know if anyone having this kind of problem or any suggestions for this. Thanks in advance.

Android Dependencies:

implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.google.firebase:firebase-ads:19.6.0'
implementation 'com.google.firebase:firebase-dynamic-links:17.0.0'
implementation "com.google.firebase:firebase-messaging:20.0.1"
implementation 'com.google.firebase:firebase-analytics'
implementation "com.google.firebase:firebase-invites:17.0.0"
implementation 'com.google.firebase:firebase-auth:19.0.0'
implementation 'com.google.android.gms:play-services-ads:19.6.0'

React-Native Dependencies:

"react": "16.8.6",
"react-native": "0.60.5"
"@react-native-firebase/admob": "^10.8.1",
"@react-native-firebase/analytics": "^10.8.1",
"@react-native-firebase/app": "^10.8.1",
"@react-native-firebase/dynamic-links": "^10.8.1",
"@react-native-firebase/messaging": "^10.8.1"
0 Answers
Related