Reputation: 2521
I am working on Push Notification GCM in android. I am done with basic functionality means at that i am sending a text message and receiving it as notification on android device. Now i want to send sound and image file which will be my notification on android. is there any way to do it because GCM allows message of size 4kb and i don't see any example in which an image or sound is sending as notification . Any help or link or tutorial would be appreciated.
Upvotes: 2
Views: 6935
Reputation: 11185
You're right about the size limit. It is 4kb and cannot be any larger. If you need to send an image / sound or other binary data, send custom json with the message that points to a URL that houses the binary data (say http://myserver.com/mysoundfile.ext).
Your custom GCMIntentService
can parse the data and download the file through an AsyncTask
. If the file size is large use the DownloadManager
service.
Upvotes: 9