Android GCM SENDER_ID, how to get it?

前端 未结 10 1721
温柔的废话
温柔的废话 2020-12-01 02:19

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 google. In this project I need, if I

相关标签:
10条回答
  • 2020-12-01 02:53

    We spent hours trying to figure this out. The problem was that our android manifest did not include the sender id!

    0 讨论(0)
  • 2020-12-01 02:55

    Maybe you haven't activated Google Cloud Messaging for Android in API COnsole. Here is the instructions:

    http://developer.android.com/google/gcm/gs.html

    0 讨论(0)
  • 2020-12-01 02:57

    Go to "Dashboard" in the latest version of the developers console, click the drop down arrow under "Project: Turtle Power" and you can see the Project number right there! Use that as your SENDER_ID

    (fake project so don't even try it =P)

    0 讨论(0)
  • 2020-12-01 02:58

    the SENDER_ID you are using is nothing but the authorization key. you can find the SENDER_ID at your projects Google APIs Console pages URL

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

    here 8543162367 will be your SENDER_ID , and also the Project Id is no longer numeric its alpha-numeric or only numeric or only alphabetic anything but its position is same as shown by me

    0 讨论(0)
  • 2020-12-01 03:02

    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

    0 讨论(0)
  • 2020-12-01 03:04

    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.

    0 讨论(0)
提交回复
热议问题