Reputation: 361
I use GCM a long time but with the new Google Console Interface, the behaviour is a little different.
You have to create the Project and get the Project ID. This is the GCM Sender ID. That´s ok.
But after that you have to create the App.
The GCM documentation says to create an App and click "Android > Accessing APIs directly from Android".
Docs here: http://developer.android.com/google/gcm/gs.html.
This should be the API KEY to send messages in the server, but it doesn´t work.
But if I create a Web App and get the "> Server Key > API Key" it works!
This makes sense? thank you
Upvotes: 1
Views: 1991
Reputation: 393771
I followed the exact steps specified by Android and it worked exactly as they say it should.
To obtain an API key:
1. In the sidebar on the left, select APIs & auth > Registered apps. 2. Click Register app. 3. In the Name field, type your app's name. 4. Click Android > Accessing APIs directly from Android. 5. Under Android identification, type the package name for your app. 6. Enter an SHA1 fingerprint. To get this value, follow the instructions in the console help. 7. Click Register. 8 .In the new page, open the Android Key section and copy the API key. You will need the API key later on to perform authentication in your application server.
And I got the SHA1 fingerprint with the command:
keytool -exportcert -alias androiddebugkey -keystore C:\Users\myusername\.android\debug.keystore -list -v
(and password android
)
Upvotes: 1