Android Gcm Sender_Id, How to Get It

Android GCM SENDER_ID, how to get it?

No, the SENDER_ID is the project ID you signed up at Google API console, it should a numeric string. e.g. on your browser URI, you should see this:

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

The Sender ID is 4815162342

Updated Answer:

Google has not updated its docs completely. The above answer is old and its based on this documentation and it seems that its still not updated.

According to updated Google docs, it seems that Project Number on Google API Console is used as SENDER ID

Android GCM SENDER_ID, how to get it?

No, the SENDER_ID is the project ID you signed up at Google API console, it should a numeric string. e.g. on your browser URI, you should see this:

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

The Sender ID is 4815162342

Updated Answer:

Google has not updated its docs completely. The above answer is old and its based on this documentation and it seems that its still not updated.

According to updated Google docs, it seems that Project Number on Google API Console is used as SENDER ID

How to get sender_id by receiving gcm notification

extras ().get("from") should give you the sender ID in your onHandleIntent method.

Where do I find my GCM sender ID?

With the new rebranding of GCM (Google Cloud Messaging) to FCM (Firebase Cloud Messaging) finding the "GCM Sender Id" and the "API Key" has changed.

To get them:

1- Login to https://console.firebase.google.com



2- Create a new project for your app (or select your project and skip to step 3):

Create new project


2B- and fill the data on the popup

fill the projectName on the popup


3- On the 'Overview' screen, select "Add Firebase to your Web App" (or skip to step 4, if previously added)

select Add Firebase to your web app

3B- Just dismiss the resulting popup:

just ignore the resulting popup
4- Go to the Project Settings page:

Go to Project Settings: Settings wheel-->Project Settings
5- And finally to the "Cloud Messaging" tab. Your "(GCM) Sender Id" and the "Server (API) Key" are there:

Go to Cloud Messaging tab

Android: Should the GCM SENDER_ID be kept secret?

Shouldn't it be kept secret ?

No, it's not required to keep it secret. If anyone decompile your APK and find anyhow your sender ID then hacker cant do anything.

Because to push GCM notification it's required to have API key of Server which is available to owner only.



Related Topics



Leave a reply



Submit