I just started working on google cloud messaging. I downloaded a sample from github. In the RegistrationIntnentService to get token from GCM Server we do
InstanceID instanceID = InstanceID.getInstance(this);
String token = instanceID.getToken(getString(R.string.gcm_defaultSenderId),
GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
and I don't understand what scope INSTANCE_ID_SCOPE defines on GCM Server.
Here it says
"Specifies scope used in obtaining GCM registrationToken when calling getToken(String, String)
Constant Value: "GCM""
And here the correct answer marked says
Note that you must use GoogleCloudMessaging.INSTANCE_ID_SCOPE as the second parameter - InstanceID is more general than just GCM, hence why it is a parameter that can take any String, but GCM specifically requires that authorization scope.
From what I understand from this is that you cannot replace INSTANCE_ID_SCOPE argument with a value other then "GCM" but I changed it and it is still receiving messages from GCM connection server.
Any help or documentation or link will be greatly appreciated.