0
votes

I followed a tutorial about GCM Notifications located on the link below: http://techlovejump.com/android-push-notification-using-google-cloud-messaging-gcm-php-google-play-service-library/

Everything worked fine for me, but, it works only on the emulator. When i transfer the same apk file to mobile devices, they do not receive notifications while the same app on emulator receives them.

Is there any way i can fix this issue?

1
Could you post some code ? - Moumou
are you using signed apk - karan
Another thing, are you sure you have the right permissions for c2dm ? Could you post that your manifest ? - Moumou

1 Answers

0
votes

The only reason I see that this can happen is when the registration_ID is changed. When this happens the device which is supposed to receive the notification as per the expectations does not receives it because the registration_ID is tied to a different device and account.

Make sure you have a distinct registration_ID for the new test device. And even if the versions of Android OS are different on both you need to re-register. Also you need to check that the Registration_ID is getting refreshed everytime in the Broadcast receiver Bundle when it receives a new Registration_ID from Google.

Since gcm.register() is deprecated make use of the new concept Instance_ID by Google.