android - Is it expected that InstanceId change on app force stopped? -
i trying out play services gcm 7.5. however, looks nice have instanceid class. however, instance id string changes every time swipe app out of recent tasks, or force stop app. doesn't change if activity finish(). expected behavior? shall instance id persisted first it?
below codes gcm token , 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 codes read instance id later:
instanceid instanceid = instanceid.getinstance(this) tokentextview.settext(instanceid.getid());
to fix update gcm, can confirm gcm 7.8 works fine.
Comments
Post a Comment