firebase messaging image not displaying via payload in android but it is working fine in iOS
I/FirebaseMessaging( 1559): Starting download of: https://www.kindpng.com/picc/m/252-2524695_dummy-profile-image-jpg-hd-png-download.png
W/FirebaseMessaging( 1559): Failed to download image: java.io.FileNotFoundException: https://www.kindpng.com/picc/m/252-2524695_dummy-profile-image-jpg-hd-png-download.png
here is my payload
{
"message": {
"token": "fh748hf......",
"notification": {
"body": "This is an FCM notification message!",
"title": "FCM Message"
},
"data": {
"body": "This is an FCM notification message!",
"title": "FCM Message"
},
"android": {
"notification": {
"image": "https://www.kindpng.com/picc/m/252-2524695_dummy-profile-image-jpg-hd-png-download.png"
}
},
"apns": {
"payload": {
"aps": {
"mutable-content": 1
}
},
"fcm_options": {
"image": "https://www.kindpng.com/picc/m/252-2524695_dummy-profile-image-jpg-hd-png-download.png"
}
}
}
}
CodePudding user response:
Below command returns 403 Forbidden.
curl -v https://www.kindpng.com/picc/m/252-2524695_dummy-profile-image-jpg-hd-png-download.png --output image.png
After adding user agent the download succeeded.
curl -v --user-agent "foobar" https://www.kindpng.com/picc/m/252-2524695_dummy-profile-image-jpg-hd-png-download.png --output image.png
Worth of trying.