Shekhar Jadhav
Shekhar Jadhav

Reputation: 1035

How to get unique identifiacation number of iphone

I want to get unique id of iphone.currently I am using Display.getInstance().getUdid(); but it gives different unique id each time I install an application on iphone. Can you please let me how to resolve it?

Upvotes: 2

Views: 86

Answers (3)

Abhishek B
Abhishek B

Reputation: 148

You can get it by calling this function:

UIDevice.currentDevice().identifierForVendor

Upvotes: 2

Shai Almog
Shai Almog

Reputation: 52760

getUDID() returns a faux number that can't be made unique due to Apple's restrictions.

Upvotes: 2

Tony Vincent
Tony Vincent

Reputation: 14282

You can no longer get the Unique id per device because of apples revised security policy . identifierForVendor is the best alternative you can go for. You can try

UIDevice *device = [UIDevice currentDevice];

NSString  *currentDeviceId = [[device identifierForVendor]UUIDString];

Upvotes: 3

Related Questions