NickT
NickT

Reputation: 23873

Android GCM project id, which one?

I returned to looking at the Android GCM service after a break and got confused regarding the project ID as described in the 'getting started' guide:

Click Create project. Your browser URL will change to something like:

https://code.google.com/apis/console/#project:4815162342

Take note of the value after #project: (4815162342 in this example). This is your project ID, and it will be used later on as the GCM sender ID.

Let's call this ID_1

I'd forgotten that my project ID was there to see on the Console API's link in my browser, so thinking I didn't have a project ID, I registered the project through the Google API console and clicked the 'register' link. I got to choose an ID, so now when I look at the console dashboard for my project I get to see something of the form:

Dashboard

Project Summary Name    MYGCMProject
Project ID              i-picked-this-id-2-11b-36
Owners                  me@myemail - you

Let's call the 'i-picked-this' value ID_2

So my question is which value (ID_1 or ID_2) do I use in the the client's registerClient code

GCMRegistrar.register(this, PROJECT_ID); 

?

If it's still ID_1, what use is the ID that I chose when I registered the project via the API console?

(I've seen this question Android GCM- Register Id and Project Id which was the closest similar one, and it doesn't shed any light at all on my query)

Upvotes: 7

Views: 8105

Answers (3)

Pedro
Pedro

Reputation: 2823

Once logged in to the Google API Console, click the hamburger button on the top left and switch to "IAM & Admin". Then from the sidebar menu at the left pick "Settings", and note the project number on the right.

Upvotes: 1

Arnoldas Bendoraitis
Arnoldas Bendoraitis

Reputation: 1065

There are two ways to identify your project: the "project number" and the "project ID."

The project ID is an optional identifier that you can assign to your own project. It's used by services like Google Cloud SQL when they need access to your project's resources.

You don't need to assign your project an ID until you enable one of the services that requires an ID.

Upvotes: 2

MAC
MAC

Reputation: 15847

4815 1623 42 this one and it should be **twelve digit**

find it from URL = https://code.google.com/apis/console/#project:4815162342 <---

Upvotes: 5

Related Questions