I am developing application where I want to implement push notification for that I am using GCM, I have registered my project on google console and using project ID as senderID for GCM registraton.
GCMRegistrar.checkDevice(this); //no error
GCMRegistrar.checkManifest(this); //no error
final String regId = GCMRegistrar.getRegistrationId(this);
if (regId.equals("")) {
GCMRegistrar.register(this, "********"); //after this..
//onError method of GCMIntentService class
//is triggered, there I am printing error
//in log its saying INVALD_SENDER
}
I have given all required permissions in AndroidManifest.xml
I Have already referred following links
1) Android GCM SENDER_ID, how to get it? 2) Getting GCM Error: INVALID_SENDER occasionally in an app that has two GCM BroadcastReceivers 3) GCM Invalid sender error 4) http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/
SENDER_ID = Project Number, I was using Project Id.. Project Number is available on console beside project id.
Google has changed its layout. you can find project_number from here
select project -> My Project
click three dots -> Project Information -> Project Number
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With