How to test GCM

2,126 views
Skip to first unread message

Jeremie Le Hen

unread,
Sep 11, 2012, 1:04:18 PM9/11/12
to andro...@googlegroups.com
Hello,

I've written a server-side GCM push application.  I have a test version APK developed by a contractor company.
Using Google APIs, I've created a new project and got my Sender ID.  Then I've generated the Server Key and got the API Key.  Perfect so far!

Now I want to check that what I send from my application is successfully pushed down to my test application.

I don't know anything in Android development, but from what I understood from the GCM documentation, the Android application DOES have to know the Sender ID during registration.  Is that correct?  (It may seem obvious, but the contractor company said me it is not needed -- which seemed quite weird to me.  This is why I checked and now ask.)

Provided I am right on the above topic and I get a new APK with the correct Sender ID compiled in, is that correct that I DO NOT need to put the APK on Google Play in order to test GCM on it?  Basically, I just use the API Key in my server-side GCM application and it will work. (Once again, I ask this because the contractor company told me I had to publish the APK on Google Play as "non-public", but I wasn't able see how to do this on "Google Play - Android Developer Console".)

Provided I am right on the above topic (again), and that publication on Google Play is not required to use GCM, what is the purpose of declaring the API Key in Google Play (you give up to 3) for an application?  Besides, I tried to declare my API Key here but I get the following error: "GCM API Key or C2DM Client Login Token not valid (Not registered.)".  Any idea?

I understand I am requesting much informations, but I hear and read contradictory informations and I have nobody around me to give me clear and right answers.  Besides, testing must be done at the end of the week :-).

Thank you very much in advance for your help.
Best regards,
-- Jeremie

flyingbag

unread,
Sep 12, 2012, 1:19:52 AM9/12/12
to andro...@googlegroups.com
Please see my comments below


On Wednesday, September 12, 2012 1:04:18 AM UTC+8, Jeremie Le Hen wrote:
Hello,

I've written a server-side GCM push application.  I have a test version APK developed by a contractor company.
Using Google APIs, I've created a new project and got my Sender ID.  Then I've generated the Server Key and got the API Key.  Perfect so far!

Now I want to check that what I send from my application is successfully pushed down to my test application.

I don't know anything in Android development, but from what I understood from the GCM documentation, the Android application DOES have to know the Sender ID during registration.  Is that correct?  (It may seem obvious, but the contractor company said me it is not needed -- which seemed quite weird to me.  This is why I checked and now ask.)
>> YES - the app does indeed need the sender id
 
Provided I am right on the above topic and I get a new APK with the correct Sender ID compiled in, is that correct that I DO NOT need to put the APK on Google Play in order to test GCM on it?  Basically, I just use the API Key in my server-side GCM application and it will work. (Once again, I ask this because the contractor company told me I had to publish the APK on Google Play as "non-public", but I wasn't able see how to do this on "Google Play - Android Developer Console".)
>> YES - you do NOT need to publish the app to test GCM
 
Provided I am right on the above topic (again), and that publication on Google Play is not required to use GCM, what is the purpose of declaring the API Key in Google Play (you give up to 3) for an application?  Besides, I tried to declare my API Key here but I get the following error: "GCM API Key or C2DM Client Login Token not valid (Not registered.)".  Any idea?
>> The API key is used for authorization when your application server sends a request to GCM. If authorized - > GCM sends msg to app
 
I understand I am requesting much informations, but I hear and read contradictory informations and I have nobody around me to give me clear and right answers.  Besides, testing must be done at the end of the week :-).
>> No worries ... good luck.

Relsell Global

unread,
Sep 12, 2012, 3:22:28 AM9/12/12
to andro...@googlegroups.com
Jeremie is right. Moreover For GCM you need to have one google account logged in (In device or emulator on which application is getting tested) otherwise the developer will be welcomed by a message SERVICE_NOT_AVAILABLE. I have implemented GCM android app demonstration. Soon I will update link.


--
You received this message because you are subscribed to the Google Groups "android-gcm" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-gcm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/android-gcm/-/UtdI0joU6x8J.

For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Thanks !
We respect your patience and cooperation.!

- Regards

Jeremie Le Hen

unread,
Sep 12, 2012, 6:17:38 AM9/12/12
to andro...@googlegroups.com
Hello,


On Wednesday, September 12, 2012 7:19:52 AM UTC+2, flyingbag wrote:
Please see my comments below

First, thank you very much for your answers.
I have one more question though.


On Wednesday, September 12, 2012 1:04:18 AM UTC+8, Jeremie Le Hen wrote:
Provided I am right on the above topic (again), and that publication on Google Play is not required to use GCM, what is the purpose of declaring the API Key in Google Play (you give up to 3) for an application?  Besides, I tried to declare my API Key here but I get the following error: "GCM API Key or C2DM Client Login Token not valid (Not registered.)".  Any idea?
>> The API key is used for authorization when your application server sends a request to GCM. If authorized - > GCM sends msg to app
 
Ok.  Do you know by chance, why Google Play refuses my API Key?

The "Key for server apps (with IP locking)" is refused with the following message: "GCM API Key or C2DM Client Login Token not valid (Not registered.)"

Whereas the "Key for browser apps (with referers)" is accepted.

-- Jeremie
Reply all
Reply to author
Forward
0 new messages