Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

INVALID_SENDER error at GCM registration

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/

like image 401
DCoder Avatar asked Nov 28 '22 00:11

DCoder


2 Answers

SENDER_ID = Project Number, I was using Project Id.. Project Number is available on console beside project id.

like image 186
DCoder Avatar answered Dec 06 '22 12:12

DCoder


Google has changed its layout. you can find project_number from here

select project -> My Project

click three dots -> Project Information -> Project Number

enter image description here

like image 33
Kishore Jethava Avatar answered Dec 06 '22 11:12

Kishore Jethava