Is the InstanceId change expected in the application to stop?

I've tried Play Services GCM 7.5. However, the InstanceID class looks like. However, the instance ID string changes every time I remove the app from recent tasks or force stop the app. It does not change if the operation is completed (). Is the behavior expected? Does the instance id stay first when we get it?

Below are the codes to get the GCM token and instance id:

            InstanceID instanceID = InstanceID.getInstance(this);
            String token = instanceID.getToken(getString(R.string.gcm_defaultSenderId), GoogleCloudMessaging.INSTANCE_ID_SCOPE);
            Log.e("FOO", getClass().getSimpleName() + ": " + instanceID.getId() + " | " + token);
            sendPushRegistrationTokenToServer(token);

      

Below are the codes to read the instance id later:

            InstanceID instanceID = InstanceID.getInstance(this)
            tokenTextView.setText(instanceID.getId());

      

+2


source to share


1 answer


To fix this GCM update, I can confirm that GCM 7.8 is working fine.



+1


source







All Articles