Unable to make Google Cloud Messaging work

I have completed the new tutorial Deploying GCM Client on Android , and I cannot do this.

I receive a token with my device successfully, and when I send the following message

{
  "to": "f19jCbaw-S4:APA91b....",
  "notification": {
    "body": "body",
    "title": "title"
  },
  "data": {
    "message": "test"
  }
}

to https://gcm-http.googleapis.com/gcm/send , I get the result:

{
"multicast_id": 844556567...,
"success": 1,
"failure": 0,
"canonical_ids": 0,
"results": [
{
"message_id": "0:1433092445706613%..."
}
]
}

But my application never enters the onMessageReceived of MyGcmListenerService class. The only key I have is the following log trace:

 6399-6454/com.miapp.app W/GcmNotification﹕ Failed to show notification: Missing icon

I’ve phased out a sample Google Cloud Messaging Quickstart project . Obviusly I use my api key and sender ID ... but id does not work, my application never stops on my onMessageReceived method.

Does anyone else have this problem?

+4
1

, "onMessageReceived" , , " : ".

AndroidManifest.xml( , ), .

, .

, :

mipmap, :

"icon" : "ic_launcher"

, :

"icon" : "@drawable/ic_myicon"

, :

{
  "to": "f19jCbaw-S4:APA91b....",
  "notification": {
    "body": "body",
    "title": "title",
    "icon" : "@drawable/ic_myicon"
  },
  "data": {
    "message": "test"
  }
 }
+5

All Articles