distriqt / airnativeextensions

DEPRECATED: Original repository of the distriqt native extensions and is no longer maintained. Please see our site for the latest ANEs
https://airnativeextensions.com
2 stars 0 forks source link

iOS uniqueId #285

Closed Cellap closed 8 years ago

Cellap commented 9 years ago

Hi,

I use the Application native extension to retrieve the id of an iOS device but after every install of my app returns a different id.

The code is pretty straightforward: m_deviceId = Application.service.device.uniqueId();

Is that expected? Is there a way in which I can get the same string after each new install?

Thanks,

David

marchbold commented 9 years ago

Hi,

This value is returning the Apple approved identifierForVendor value. From the Apple documentation:

The value of this property is the same for apps that come from the same vendor running on the same device. A different value is returned for apps on the same device that come from different vendors, and for apps on different devices regardless of vendor.*

The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor’s apps from the device and subsequently reinstalls one or more of them. The value can also change when installing test builds using Xcode or when installing an app on a device using ad-hoc distribution. Therefore, if your app stores the value of this property anywhere, you should gracefully handle situations where the identifier changes.*