Closed khurshid-alam closed 8 years ago
@khurshid-alam GCM's built-in notification support is limited to setting the notification title / body / icon and a few other properties, but not an image: https://developers.google.com/cloud-messaging/http-server-ref#downstream-http-messages-json
To display an image like the one you posted, you need to dispatch your own Notification
using the Notification.BigPictureStyle
, passing in the image like so:
https://developer.android.com/reference/android/app/Notification.BigPictureStyle.html
You can send a link to download the image via GCM, have the device download it, read it into a Bitmap
, and then display it using NotificationManager
.
Good luck, and if you have any trouble, please consult StackOverflow. =)
yes @khurshid-alam, but @eladnava said was right and if you want you can do what ever you want. you need to override the Notification.
You need pass image URL as parameter in payload like body or data attributes and based on your logic Notification will display.
You need to take care about the image sizes, if it is big image notification looks ugly.
Is it possible to send big picture style notification with this?