0
votes

I want to send push notification to my application. My back end is ready and I am also able to receive the gcm registration id from the server but I am not able to receive notification on my device. Can anyone help me with that. Also is it necessary that the application needs to be downloaded from play store to send the notification or we can test the notification in debug apk also?

I implemented the push notification from the link given below: http://javapapers.com/android/google-cloud-messaging-gcm-for-android-and-push-notifications/

1
Have you get Unauthorized Error 401? If the Google API key is wrong or the IP address of the server machine is not white listed at Google GCM server. Then you will get. Also, In that example, passed data must be a JSON array.bjiang
I didn't used server key, instead I am using browser key in the api console.Jarvis
You can check the official doc here to get some ideasbjiang

1 Answers

0
votes

GCM notifications work perfectly with debug APKs.

There is something wrong in the client code or the server code.

If you are getting a success response from Google server AND if you are able to see the logcat logs of the received GCM message in your GCM intent service then your server side code is working well and there is probably an error in the client code. If you receive a failure message from the the Google server or do not see logs, then the issue is in your server code.

Note: You need to use the server key.

You can use this GCM Test Tool as the server to test if your client is working or not.