php - Special messages on Google Cloud Messaging (PUSH to Android) -
I can send the string to my android phone through push system
At least I have seen on my iPhone that people push push with images, push with play / stop control (IIRC), push with custom sounds.
How can I send such data to Android phones?
My current data:
$ fields = array ('registration_ids' = & gt; $ registration_ids, 'data' = & gt; array ("message" = & Gt; $ message),);
$ message is a string.
This is the plugin I am using:
Edit:
Spend some time in studying After I came to a conclusion that you are only able to send a string or an array of data
and to keep an image on the push notification, you must send a certain message, And then continue to change the push notification view to show the image. So do not have a build-in image support, or are there Play / Pause buttons for that matter? Am I on the right track?
You are right from a custom property in the payload, sending your app through your GCM server to your server. Not only is this a list of keys / values added within the data array, which is limited to 4K bytes. This is not enough for an image encoding.
When you receive this payload in your app, it is up to you to decide what to do with it, and writing the code that you write is your responsibility. The most common behavior is to display a notification, and Opens the app when the notification is taped. The payload can have a URL for the picture that you can download and display.
There are several options in it, and new Android versions improve. I am sure that you can use it to achieve your desired behavior, it does not have to do anything with GCM.
Comments
Post a Comment