Reputation: 1035
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
Reputation: 148
You can get it by calling this function:
UIDevice.currentDevice().identifierForVendor
Upvotes: 2
Reputation: 52760
getUDID()
returns a faux number that can't be made unique due to Apple's restrictions.
Upvotes: 2
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