Android Question Send an image using FCM. It's possible?

javiers

Active Member
Licensed User
Longtime User
Hello, I want to send an image using FCM.
I get the image and encode it with Base64EncodeDecodeImage.
The size is 8300000 bytes. If I compress it with GZipStrings the size is 6200000.
Sending the message with FCM gives an error.

Can an image be sent via FCM, or is there a message size limitation? (I've seen it maybe 4000 bytes).
Would it be better to use MQTT to send the image? The goal is to save it to an SQLite field on the receiving device.

Thanks for the help.
 

DonManfred

Expert
Licensed User
Longtime User
4000 bytes for Title AND Body at all.
It is not possible to send more. In the Firebaseconsole it is only 1024 bytes.

Send a ID for the Image and send the image itself over MQTT or similar.

Your app can also download the image when a notification arrives based on the info provided in the Notification.
No need to have MQTT running too. A Webserver to deliver the files is enough.
 
Upvote 0
Top