I try to migrate to GCM and I have an issue with the SENDER_ID I need to provide. I use the demo project from goole. In this project I need, if I understand this well, to provide a SENDER_ID to the application in the CommonUtilities.java file.

I did some experiments - I couldn't find an complete answer on the Internet and in the end I discovered that the sender_id is the email used to register to the service. If you want your answer to get mark as accepted, please edit it.
–
Zelter AdyJul 2 '12 at 18:58

3

Zelter, using email address as the sender_id is the deprecated C2DM way of registration. See here: developer.android.com/guide/google/gcm/c2dm.html, under 'Client Changes': Migration is simple! The only change required in the application is replacing the email account passed in the sender parameter of the registration intent with the project ID generated when signing up for the new service.
–
azgolferJul 2 '12 at 20:03

1

For server side, it's more involved, the URL link I referenced in the above comment is a good starting place. Basically change the Authorization header to use the new API key, and the Http POST body now accepts a JSON string.
–
azgolferJul 2 '12 at 22:06

2

Thanks azgolfer. How can the migration possibly expect anyone to know this? It's almost as if Google is going out of their way to make it as tricky as possible.
–
AmorgosOct 18 '12 at 18:39

1

hey @azgolfer can you update your answer based on my answer below? stackoverflow.com/a/27020029/231768 GCM has changed from Project ID being used, and they use a Project Number
–
AdamJan 2 at 20:39

An updated answer as of Nov 2014 IF YOU'VE CREATED AN API PROJECT RECENTLY.

First of all, correct, you should absolutely go to the Google Developers Console and find the Project that you have GCM enabled on. When looking at the Overview section (left-hand nav panel), you'll see Project ID and Project Number listed on the right hand side. Project ID was failing for me (which is what led me here), but when I tried the Project Number, I'm able to register my clients correctly now.

Note that this is different because Google modified how they assign project IDs recently. In October I made a project and was given an all numerical Project ID, which I assume would work fine. But the one I created today was given a two-word and a number id (like Hamster-Party-420) and a numeric Project Number. The URL to my project contains Hamster-Party-420, and the Project Number is only visible on the Overview screen.

Yet another updated answer with little more explanation for the confused(..like I was).(with due credit to @azgolfer, @PankajAndroid and @Adam)

1- If you create a project at https://console.developers.google.com, you can see two things "PROJECT ID" and "PROJECT NUMBER" in project overview. Project Id is no longer numeric but alpha numeric like master-xxxxx-1234. Project number is a 11 digit number like 123456789100.

2- Even when you inspect the browser link you can find it as:
https://console.developers.google.com/project/master-xxxxx-1234

So is master-xxxxx-1234 is the SENDER_ID (at some places referred as PROJECT ID)? NO.

You have to use the project number as project id in GCM.

3- Where can you cross check that project id is being used as project id?

SUMMARY: Project Id in Project Dashboard and API Dashboard are different. The project number in project dashbaord is used as project id in API Dashboard and Project Id in project dashbaord as Project name in API Dashboard. So the project number shown in the Project Dashboard when we create project in developer console is used as SENDER_ID in GCM.