public class MyGcmListenerService
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
MyGcmListenerService.QuickstartPreferences |
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
TAG |
Modifier and Type | Method and Description |
---|---|
void |
onMessageReceived(java.lang.String from,
Bundle data)
Called when message is received.
|
private void |
sendNotification(java.lang.String message,
java.lang.String squareName,
java.lang.String squareId)
Create and show a simple notification containing the received GCM message.
|
private void |
updateSquares(java.lang.String userId,
java.lang.String squareId,
java.lang.String event)
Method that notifies listeners that some square data changed
|
private static final java.lang.String TAG
public void onMessageReceived(java.lang.String from, Bundle data)
from
- SenderID of the sender.data
- Data bundle containing message data as key/value pairs.
For Set of keys use data.keySet().updateSquares(String, String, String)
,
sendNotification(String, String, String)
private void updateSquares(java.lang.String userId, java.lang.String squareId, java.lang.String event)
userId
- the id of the usersquareId
- the id of the square that changedevent
- what changedprivate void sendNotification(java.lang.String message, java.lang.String squareName, java.lang.String squareId)
message
- GCM message received.