Reputation: 508
i got confused by gcm today. I dont know if my registrationid is correct. I got characters and a colon in front of a registrationid starting with APA. The Pattern is xXXXxxX:APA... . I implemented google cloud messaging for a android client using the example from here: https://developers.google.com/cloud-messaging/android/client . If i use a older implementation (for example with GCMRegistrar) i only get a registration id starting with APA. Till now i though a registration id has to start with APA.
Is the stuff before the colon some tokenspecific stuff? Do i have to pass the full token to the webservice or is it okay if i cut the chars before the colon and send the registration starting with APA?
Upvotes: 2
Views: 1165
Reputation: 37798
GCM Registration Token is equal to registration_id. As I mentioned in my answer here:
An FCM Token, or much commonly known as a registrationToken
like in google-cloud-messaging. As described in the GCM docs:
An ID issued by the GCM connection servers to the client app that allows it to receive messages. Note that registration tokens must be kept secret.
Different terms point to the same thing. The format for the registration token may also vary as seen this answer:
The GCM registration token is usually around 140 chars in length, and can contain colons, underscores and hyphens. Maximum size is supposed to be 4k.
Though I'm not entirely sure with regards to the character length, I think I've read on a post here somewhere that it may exceed that number. Do search around.
Upvotes: 4
Reputation: 3654
gcm.register() is deprecated. use instance id method with token instead.
https://developers.google.com/cloud-messaging/android/legacy-regid
GCM register() is deprecated starting May 28, 2015. New app development should use the Instance ID API to handle the creation, rotation, and updating of registration tokens. For more information, see Registering Client Apps and Set up a GCM Client App on Android.
Upvotes: 1