The documentation for GCM says that the application server should send messages to GCM devices using https://gcm-http.googleapis.com/cloud-messaging/send , but the sample program (in the GcmSender class) uses https: // android. googleapis.com/gcm/send .
Which one is correct?
For several years, I had a GCM application in a field that uses the last URL, and on the client side older classes are used, not the classes currently documented. I guess this means that my implementation is C2DM, not GCM, but the above URL inconsistency makes me fuzzy. In addition to the URL, my application server implementation matches what is documented today, for example, it uses this format to send messages to GCM devices:
Content-Type: application / JSON Authorization: key = AIzaSyZ-1u ... 0GBYzPu7Udno5aA
{"registration_id": "APA91bHun4MxP5egoKMwt2KZFBaFUH-1RYqx ...", "data": {...},}
It's also odd - the sample application uses "in" rather than "registration_id", and my own application uses "registration_ids".
In addition, my application server never used the “ClientLogin Auth token”, which is why documents make me believe that all C2DM applications use. This adds me to the confusion as to whether my implementation is C2DM or GCM, and therefore whether it will stop working on 10/20/2015 or continue to work.
Can someone clarify?
Thanks,
Mark
source
share