0
votes

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...

1
What do you mean by data payload? Did you use the standard JSON form for GCM here? I sent post json message via postman(browser) and it works.bjiang

1 Answers

1
votes

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).