Paul Medawar
Posts: 0
Joined: Thu Apr 03, 2014 10:55 am

Automatically updating deviceID when it changes on a device

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

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Automatically updating deviceID when it changes on a device

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.

Paul Medawar
Posts: 0
Joined: Thu Apr 03, 2014 10:55 am

Automatically updating deviceID when it changes on a device

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?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Automatically updating deviceID when it changes on a device

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

Paul Medawar
Posts: 0
Joined: Thu Apr 03, 2014 10:55 am

Automatically updating deviceID when it changes on a device

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

Paul Medawar
Posts: 0
Joined: Thu Apr 03, 2014 10:55 am

Automatically updating deviceID when it changes on a device

Hi, any update on this?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Automatically updating deviceID when it changes on a device

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...

Paul Medawar
Posts: 0
Joined: Thu Apr 03, 2014 10:55 am

Automatically updating deviceID when it changes on a device

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.

Paul Medawar
Posts: 0
Joined: Thu Apr 03, 2014 10:55 am

Automatically updating deviceID when it changes on a device

Hello?

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

Return to “Issues”