Page 2 of 3

Automatically updating deviceID when it changes on a device

Posted: Mon Jun 08, 2015 7:55 am
by Paul Medawar

Your documentation recommends that deviceID should be targeted when making changes to the "devices" collection, as "token" can change.

I have followed this and created a checkboxgroup to update the "channels" in the devices collection.

This works.

That is until the app is updated or deleted and reinstalled. At this point the deviceID on the device changes, and is therefore out of sync with the deviceID in the collection.

Image

Image


Automatically updating deviceID when it changes on a device

Posted: Mon Jun 08, 2015 8:34 am
by Illya Stepanov

You will need to store additional information about the device and store it in Devices collection every time when service register/update is called.

Or you can store this information in collection, for example if you have user registration, you can add field to user records.


Automatically updating deviceID when it changes on a device

Posted: Mon Jun 08, 2015 9:02 am
by Paul Medawar

The second point regarding user registration I understand and have implemented in another app.

However this app does not have user registration, and I am following your documentation guidelines to use deviceID.

If I do not use deviceID as suggested, what additional information about the device do you suggest I store?


Automatically updating deviceID when it changes on a device

Posted: Mon Jun 08, 2015 9:26 am
by Illya Stepanov

Sorry Paul, you're trying to say that you can't get changed Device ID on the device?


Automatically updating deviceID when it changes on a device

Posted: Mon Jun 08, 2015 10:06 am
by Paul Medawar

say for example the first time I load the app on to the device.

The device is registered automatically in to the device collection.

My checkboxgroup uses the pushNotificationDeviceID Local storage variable to identify the deviceID in the collection and update the channels.

lets say deviceID is

209623CE-xxxx-xxxx-xxxx-xxxxxxxxxxxx

and I set channels ["1","2"] for this device in the checkboxgroup

this works great, and the channels are updated.

However when the deviceID on the device changes, for example to

B1B45277-xxxx-xxxx-xxxx-xxxxxxxxxxxx

trying to use the PUT method does not work, because the deviceID in the collection is still

209623CE-xxxx-xxxx-xxxx-xxxxxxxxxxxx

but the pushNotificationDeviceID LSV on the device is showing

B1B45277-xxxx-xxxx-xxxx-xxxxxxxxxxxx


Automatically updating deviceID when it changes on a device

Posted: Tue Jun 09, 2015 7:43 am
by Paul Medawar

Hi, any update on this?


Automatically updating deviceID when it changes on a device

Posted: Wed Jun 10, 2015 7:40 am
by Paul Medawar

Hi, anything?


Automatically updating deviceID when it changes on a device

Posted: Wed Jun 10, 2015 12:26 pm
by Serhii Kulibaba

Paul, please use device UUID (The details of how a UUID is generated are determined by the device manufacturer and are specific to the device's platform or model.) to detect specific device: http://docs.phonegap.com/en/edge/cord...


Automatically updating deviceID when it changes on a device

Posted: Thu Jun 11, 2015 2:32 pm
by Paul Medawar

Sergiy

from the link you supplied

"The uuid on iOS is not unique to a device, but varies for each application, for each installation. It changes if you delete and re-install the app, and possibly also when you upgrade iOS, or even upgrade the app per version (apparent in iOS 5.1). The uuid is not a reliable value."

so does not work!

I have just loaded three different instances of the same app on to an Iphone, all showing 2 labels, one with "deviceID" and the other "token", obtained from "pushNotificationDeviceID" and "pushNotificationToken"

Instance 1

DeviceID = 513999EE-xxxx-xxxx-xxxx-xxxxxxxxxxxx
token = 1d0c4cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxeb2

Instance 2

DeviceID = 21F80D49-xxxx-xxxx-xxxx-xxxxxxxxxxxx
token = 1d0c4cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxeb2

Instance 3

DeviceID = 62887C01-xxxx-xxxx-xxxx-xxxxxxxxxxxx
token = 1d0c4cxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxeb2

Your documentation says

"To target a specific ID use deviceID instead of a token because a token is issued by Apple/Google services and can be changed."

You can see that I am getting directly the opposite outcome, with the "token" remaining consistent and the "DeviceID" changing???

Please give me clarification on this exact issue.

Also can you please unmark this as being answered until there is some clarification.


Automatically updating deviceID when it changes on a device

Posted: Sun Jun 14, 2015 5:52 am
by Paul Medawar

Hello?

any update on this? and can you please unmark this as being answered until there is some clarification?