user1062198
user1062198

Reputation: 31

android gcm push doesn't work with json tag notification

I create an android gcm client. I read this guide: https://developers.google.com/cloud-messaging/android/client and i use this example https://github.com/googlesamples/google-services/tree/master/android/gcm My app workes, it receives Push but only when our server application sends json with "data payload".. when our server sends json message with notification payload my android app does'nt receive push. I read: "Use notifications when you want GCM to handle displaying a notification on your Android client app’s behalf," but it doesn't work in Android...

Upvotes: 0

Views: 423

Answers (1)

Medo
Medo

Reputation: 63

From what I can guess, you probably just don't have the icon key in your json which is required for Android but not for iOS, try to add something like "icon" : "@drawable/myIcon.png" in your notification dictionary. (I would have asked for a sample of your Json in the comment instead of guessing if I could but I'm still pretty new and can't comment everything yet).

Upvotes: 1

Related Questions