Question

I need to get iPhone unique number programmatically. I know that apple will reject app if I try to gain iPhone serial number.

But may be there is a way to get any unique number of iPhone, so server can distinguish  one device from another.

Was it helpful?

Solution

For each iPhone, MAC address is unique ( except for iOS Simulator ). You can obtain the information to identify the device. This question will guide you to get MAC address. However, iOS7 disallows use of MAC address. Therefore, for iOS 6 or before, you can use MAC address; for the coming iOS 7, you can use the following method.

Since iOS 6, Apple suggests to use Advertising Identifier, which can be found in ASIdentifierManager class. Example code:

NSUUID *uuid = [ASIdentifierManager advertisingIdentifier];

OTHER TIPS

Have you looked at identifierForVendor?

https://developer.apple.com/library/ios/documentation/uikit/reference/UIDevice_Class/Reference/UIDevice.html#//apple_ref/occ/instp/UIDevice/identifierForVendor

Apple describe it as:

An alphanumeric string that uniquely identifies a device to the app’s vendor.

You should try this to get uid of your iPhone:

 NSString *udid = [[UIDevice currentDevice] uniqueIdentifier];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top