Pregunta

From my understanding of the GCM documentation you basically send whatever data you want as the data field. Then the client receives it and is responsible for handling it and displaying it. Is this wrong? What if like on iOS I just wanted to send a bit of text and have it display? Is there a standard key to use or anything? I'm pretty certain I've been through all the documentation I can find and don't see anything like this.

¿Fue útil?

Solución

No, you're right. There are no standard keys like in iOS, it's all up to you seeing as you're the one responsible for the notification management.

Basically, in your BroadcastReceiver you should write the code for displaying a Notification in the status bar. Just parse your JSONObject from the recieved message and show whichever piece of text you may have set.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top