-
Notifications
You must be signed in to change notification settings - Fork 1.9k
"push.unregister" not really work in iOS #296
Comments
I believe that's the expected behaviour, now that this plugin uses instance-id. A new one will be generated everytime the cicle completes (register -> unregister -> re-register). |
hi @fredgalvao in iOS,after unregister and re-register,still get a same data.registrationId is a expected behaviour if yes,why Android have no this behavior just like the iOS ? |
In my android, I get the same registrationId and therefor no notifications... Update: Looks like I get different id in in 1.4.2 -- I was using 1.4.0 |
yes @adyz |
iOS links the registrationId to a combination of factors as to my experience, such as provisioningProfile used and deviceUUID, so that if you complete the re-registering cycle, you'll get the same registrationId (neither provisioning profiles nor deviceUUIDs have changed, so that's expected).
The case with Android is different now, because this plugin is using instance-id as of The recommendation here is that you talk to your server everytime the Something along the lines: push.on('registration', function(data) {
if (data.registrationId !== previousRegistrationIdPersistedSomewhere) {
var params = {uuid: device.uuid, registrationId: data.registrationId};
$.get('http://url.to.my.server/updateRegistrationIdForACertainUUID', params);
}
}) def updateRegistrationIdForACertainUUID(String uuid, String registrationId) {
def pr = PushRegistration.findByUuid(uuid)
if (pr && pr.registrationId != registrationId) {
/* I need to update it */
pr.registrationId = registrationId
pr.save()
} else if (!pr) {
/* I need to create it */
pr = new PushRegistration(uuid: uuid, registrationId: registrationId)
pr.save()
}
} |
thanks @fredgalvao |
This thread has been automatically locked. |
hi @macdonst
I am using PGB cli-5.2.0 with your 1.4.1 verison (Android 4.4.2 and iOS 9.1[13B143])
these are my prosedure
step 1
step 2
well...
when in Android,step 1 will get a "data.registrationId",after it I execute step 2,and execute step 1 again,it will get a "new and different" value
but when in iOS,step 1 will get a "data.registrationId",after it I execute step 2,and execute step 1 again,it still get a "same" value just like step 1
the "successHandler" will all trigger success
is the iOS have a different behavior than Android ?
The text was updated successfully, but these errors were encountered: