SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

pushNotificationDeviceID not unique on iOS devices

I'm using the following to obtain the device ID:

var deviceID = localStorage.getItem('pushNotificationDeviceID');

I've found that this device ID is unique on Android devices. Although on iOS devices running the same OS version, I've found the device ID is the same for every user of the app.

I've done lots of tests and found that the device ID is not unique on any device running the same app and iOS version.

I'm using this device ID to send push notifications. In my testing, the last iOS device to launch the app is the only recipient when sending push notifications to that device ID. Although other users have the same device ID and have launched the app in the past, only the last person to have launched the app receives the push notification.

Do I also need to obtain their token ID? Will this render a unique ID?

Or how else can this problem be fixed?

Thanks for your help.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

pushNotificationDeviceID not unique on iOS devices

Hi Steve,

Please check the value of device.uuid. Is it unique for different iOS devices?

SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

pushNotificationDeviceID not unique on iOS devices

So how would I retrieve the device.uuid? Would the following work?:

var UdeviceID = localStorage.getItem('device.uuid');

Is the device.uuid stored the same as the pushNotificationDeviceID?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

pushNotificationDeviceID not unique on iOS devices

Steve,

To access deviceID on Device Ready event (Page Load and Page Show won't work) you can use the following JavaScript code: predevice.uuid /preIn Appery.io you can also use:prePushNotification.getDeviceUniqueIdentifier(); /pre
This can be used on device only.

Here is a nice explanation from Marina: https://getsatisfaction.com/apperyio/...
This can be helpful also: https://getsatisfaction.com/apperyio/...

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

pushNotificationDeviceID not unique on iOS devices

Hi Steve,

pre
var deviceID = device.uuid;
/pre

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

pushNotificationDeviceID not unique on iOS devices

Hi Steve, just to add what Katya said, this is a standard PhoneGap API you can find description in their docs:
:: http://docs.phonegap.com/en/3.0.0/cor...

SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

pushNotificationDeviceID not unique on iOS devices

I've done some more testing and things are still not working properly for iOS push notifications.

On Android,

using: var deviceID = localStorage.getItem('pushNotificationDeviceID');

My Android device ID is = 99000206643728;b7ad5277e66329d7

using: var deviceID = device.uuid;

My Android device ID is = b7ad5277e66329d7

(Notice that using "device.uuid" it returns the second half of the full device ID above.)

Sending a push notification to the Android device ID returned from device.uuid does not work. Although the push notifications to Android devices using 'pushNotificationDeviceID' work properly.

On iOS,

using: var deviceID = localStorage.getItem('pushNotificationDeviceID');

My iOS device ID is = 8543e25880689e0899f4a1dd3c85bc29

using: var deviceID = device.uuid;

My iOS device ID is = 18B011BA-C4DE-45DB-8482-F01FC780

Sending a push notification to the device ID returned from device.uuid does not work.

I've tried the app with three different iOS devices running iOS7. All iOS devices return the same device ID (8543e25880689e0899f4a1dd3c85bc29). I can send a push notification to that device ID, although only the most recent iOS device to launch the app receives the notifications.

On the Android side, everything works fine (using 'pushNotificationDeviceID'), but things are not working properly for iOS.

Illya Stepanov - the link you provided mentioned an iOS quirk, but the description wasn't consistent with the behavior I'm seeing.

Any advice would be greatly appreciated.

Thanks,

Steve

SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

pushNotificationDeviceID not unique on iOS devices

Another update...

I did a test sending a notification to all devices (no filter) and the notification was only received by the last iOS device (running iOS7) to launch the app. Android devices worked just fine though.

So apparently there's also an issue registering the iOS devices (running iOS7) with the Appery Push Notification system? Is there a way to see how many devices are registered for each app in the Push Notification area?

Any help is greatly appreciated.

Thanks!

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

pushNotificationDeviceID not unique on iOS devices

Hello! Yes, looks like that http://community.phonegap.com/nitobi/...
What Libraries version you use? Set it to 1.2 if you have another one.
[quote:]Is there a way to see how many devices are registered for each app in the Push Notification area?[/quote] sure, in DB connected to app in Devices collection you can see all registered apps and deviceIDs. Try to test the following way - clear the table, install app on device, check Devices table. Install app on another device. Check Devices table again - is there new record added? Check what deviceIDs are there? Let us know result.

SteveLacy
Posts: 6
Joined: Fri Apr 20, 2012 11:54 pm

pushNotificationDeviceID not unique on iOS devices

Maryna,

Thanks for the reply.

Here's what happened in my testing using iOS7 devices.

The device ID is recorded properly for the first iOS7 device to launch the app. Although for the second iOS7 device to access the app, it doesn't add a new record but only updates the time stamp on the previous record. Apparently this is an issue related to iOS7 devices? Android and other iOS version devices behave properly.

It appeared that I was using the 1.0 library. I've updated the library to 1.2 although I won't be able to test on iOS7 devices until I deploy on the Apple App store. I can't test on iOS7 devices right now since the Appery Xcode export is not yet compatible with Xcode5. In another post, you mentioned that the January release will be compatible with Xcode5.

I'll follow up later to determine if the Library 1.2 has an impact on the problem.

Thanks!

Return to “Issues”