user987
user987

Reputation: 63

Unique Identifier should not change with iOS version change

I'm developing an application which is using device unique identifier to register device with server. I am using MacAddress to get unique identifier of device, but in iOS7 it will return same(static for all device). I found other alternate as

NSUUID *vendorId = [[UIDevice currentDevice] identifierForVendor];

But that will change as iOS device changed. So can anyone suggest me some unique identifier which will not change if iOS version change it should be same for all iOS version (iOS7, iOS6).

Upvotes: 0

Views: 271

Answers (4)

Vinay Jain
Vinay Jain

Reputation: 2634

Apple is not allowing to use the Device's UDID to identify the users. So you can do it in other way.

Instead of sending the UDID to the server, create a unique Id on the server and put that ID in the application to recognize the user. In this way, you will not break the Apple's guidelines and the problem of varying the iOS versions also get resolved with this.

Upvotes: 0

Dinesh
Dinesh

Reputation: 939

Unfortunately Apple disallows application to Uniquely identify a device (AS per them it violates User Privacy).. So you have either left with vendor ID or Advertisement ID.. another thing which you can try is that writing a web service which provides a unique ID to your app on first login and you will store that in in key chain or DB on your device..

Upvotes: 0

流觞_iviedsky
流觞_iviedsky

Reputation: 79

Just store the UUID into the keychain. sskeychain refers to https://github.com/samsoffes/sskeychain

code as following^^

NSString *identifier = [SSKeychain passwordForService:kSSToolkitTestsServiceName account:kSSToolkitTestsAccountName];

if (identifier != nil && [identifier length] > 0) {
    return identifier;
}

identifier = [[[UIDevice currentDevice] identifierForVendor] UUIDString];

[SSKeychain setPassword:identifier forService:kSSToolkitTestsServiceName account:kSSToolkitTestsAccountName];
return identifier;

Upvotes: 0

iCode
iCode

Reputation: 1466

There is a simple answer: It is not possible. Here you have an overview over the identifiers: The Developer’s Guide to Unique Identifiers

enter image description here

Upvotes: 2

Related Questions