GCM error: Invalid sender

5,466 views
Skip to first unread message

oyvinro

unread,
Jul 2, 2012, 6:05:52 AM7/2/12
to andro...@googlegroups.com
We are just getting started with GCM, not coming from C2DM. At the google API pages i registered a new project, with a specific ID and enabled GCM. I installed the demo project in Eclipse, and altered SENDER_ID in CommonUtilities.java to reflect my project ID.

It is my impression that this should be enough to be able to get my device registered in GCM, but the app returns:

From GCM:error(INVALID_SENDER)

The only debug info I find regarding this is:

Sender ID - A project ID you acquire from the API console, as described in Getting Started. The sender ID is used in the registration process to identify an Android application that is permitted to send messages to the device.

INVALID_SENDER The sender account is not recognized. This must be fixed on the Android application side. The developer must fix the application to provide the right sender extra in the com.google.android.c2dm.intent.REGISTER intent.

Am I missing something?

oyvinro

unread,
Jul 3, 2012, 7:14:30 AM7/3/12
to andro...@googlegroups.com
Ok. Got this working now. Of course, your project ID isn't what is stated as project ID in the API pages dashboard (they really should change that name). There is no link between the unique name you set and the numeric value in the url. Use the number in the url, as stated in the beginning of the "Getting started" document. Note to self: Read thoroughly.

Nino van Hooff

unread,
Aug 1, 2012, 9:01:26 AM8/1/12
to andro...@googlegroups.com
I second that, very confusing.

Op dinsdag 3 juli 2012 13:14:30 UTC+2 schreef oyvinro het volgende:

Tim O'Brien

unread,
Sep 5, 2012, 12:55:43 PM9/5/12
to andro...@googlegroups.com
I'd say, even after reading this I was still clicking all over the Google API Console trying to find an the Sender_ID.  Then I noticed the stupid address bar and the project number 

https://code.google.com/apis/console/b/0/#project:65464654646546:overview 

-----------------------------------------------------
The GCM Demo tutorial should be updated to say exact where the Sender_ID is. 

  1. Using a text editor, open samples/gcm-demo-client/src/com/google/android/gcm/demo/app/CommonUtilities.java and set the proper values for the SENDER_ID and SERVER_URL constants. For example:
  2. static final String SERVER_URL = "http://192.168.1.10:8080/gcm-demo";
    static final String SENDER_ID = "4815162342";

    Note that the SERVER_URL is the URL for the server and the application's context (or just server, if you are using App Engine), and it does not include the forward slash (/). Also note that SENDER_ID is the Google API project ID you obtained in the server setup steps above. 

    CHECK YOUR GOOGLE API CONSOLE URL FOR THE PROJECT (https://code.google.com/apis/console/b/0/#project:65464654646546:overview)

Wish my brain could just absorb all this while I sleep :|
Reply all
Reply to author
Forward
0 new messages