Reputation: 1082
I have been creating the GCM token like the following:
InstanceID instanceID = InstanceID.getInstance(this);
String token = instanceID.getToken(authorizedEntity, scope);
// [END get_token]
Log.e(TAG, "GCM Registration Token: " + token);
It was working fine, But some how I started getting "MESSENGER" term generated in some cases as a token. Not able to find a possible cause for it.
Upvotes: 14
Views: 770
Reputation: 3794
There is known bug in google. It happens also in FCM, not only GCM. Sometimes the word "AP" returned also, instead of "MESSENGER" and sometimes your own package name is returned to you. There is no fix at the moment. You can follow this issue tracker to be notified when it is resolved. As for now, the only solution I can think of is implementing re-registering mechanism with exponential back-off in time. For example, send re-register (that means unregister and register) requests after 1 second, after 2 seconds, after 4 seconds, after 16 seconds and so, until you've got registered.
Upvotes: 6