Domanda

I have been looking at ways to uniquely identify an iOS device and making sure that our app is being used on the same device as was before phone was wiped.

I know that querying for UDID has been deprecated and that there is a new method to map a device to the app: CFUUID but the problem with that approach is this UUID given by CFUUID is different on every new install of the app.

EDIT: Actually I meant

[[UIDevice currentDevice] identifierForVendor]

and not CFUUID. Sorry for this, I was referring to this identifierForVendor which is different for each time the app is uninstalled. This is what I don't want in the app. There must be a way because I wiped my phone and Testflight was able to identify it as the same device. I want to know how they could have done it.

Services like testflight and maybe all analytics services are still being able to uniquely identify devices and users even after querying MAC address (which now returns the same number for all devices) and UDID has been deprecated. Can someone tell me a mechanism to uniquely identify an iOS device such that it can be identified even after a phone wipe.

I have looked into Apple OTA Configuration but I am not sure if that can help somehow track only the device and not sending back any provisioning profiles for users that log-in to our service.

È stato utile?

Soluzione 3

There are no public (i.e. approved by Apple) ways to identify device across wipes. Both identifierForVendor and advertisingIdentifier will change if device is wiped/restored.

Services like TestFlight are able to identify devices because they install special configuration profiles that give some extra abilities to them, such as getting actual UDID.

If you're not targeting AppStore (i.e. trying to do this from AdHoc app or on jailbroken device) then there are ways to achieve this with private APIs.

Altri suggerimenti

There is no sanctioned, publicly accessible API for what you want on iOS 7.

The closest option to what you are looking for is

[[UIDevice currentDevice] identifierForVendor]

From Apple's docs:

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.

For better or for worse Apple has deprecated just about anything that could help here (and will reject your app from the AppStore if you try workarounds, though perhaps you are not planning on App Store distribution). Their rationale is that users should be able to replace/upgrade phones at will and as long as their Apple ID remains constant they get to keep using whatever assets they had before.

Of course I can imagine cases where their logic is flawed and the device matters, but it's not up to me...

Is there no way you can tie things to a user login rather than a device? If not, what you could do is generate and store a random number on the device one time.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top