Unnable to make Google Cloud Messaging Work -
i followed new tutorial implementing gcm client on android, , i'm unnable make work.
i token form device succesfully, , when send following message
{ "to": "f19jcbaw-s4:apa91b....", "notification": { "body": "body", "title": "title" }, "data": { "message": "test" } }
to https://gcm-http.googleapis.com/gcm/send, result:
{ "multicast_id": 844556567..., "success": 1, "failure": 0, "canonical_ids": 0, "results": [ { "message_id": "0:1433092445706613%..." } ] }
but app never entering the onmessagereceived of mygcmlistenerservice class. clue have following log trace:
6399-6454/com.miapp.app w/gcmnotification﹕ failed show notification: missing icon
i'm duplicated step step google cloud messaging quickstart sample project. obviusly use api key , sender id... id not work, app never stops in onmessagereceived method.
anybody else having problem?
in fact payload without notification should reach "onmessagereceived" method , work fine, if notification present payload, same error displayed "failed show notification: missing icon".
i tried set icon inside androidmanifest.xml (on both intent-filter, on receiver), nothing worked.
if not require notification, remove them payload.
and if need notification, need add required field inside notification:
if icon inside mipmap can add:
"icon" : "ic_launcher"
if icon inside drawable, should have:
"icon" : "@drawable/ic_myicon"
so new request like:
{ "to": "f19jcbaw-s4:apa91b....", "notification": { "body": "body", "title": "title", "icon" : "@drawable/ic_myicon" }, "data": { "message": "test" } }
Comments
Post a Comment