0

Hi i was searching to get ios device serial but the answer is for UDID or simple IOKit sample code ? If IOKit is good to get serial number then just tell how to add IOKit to the xcode project? Can any one help me please?

rmaddy
  • 314,917
  • 42
  • 532
  • 579
saipasumarthy9
  • 5
  • 1
  • 1
  • 2

1 Answers1

8

For privacy reasons, Apple has restricted access to network mac address from version 7 of iOS, in which it was used to determine the "serial number" of the device. There are other implementations that are based on generating a cookie to keep the single number, but Apple announced that it is strongly repressed all attempts to identify the device.

The only way I found is using identifierForVendor property. 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.

#import "UIDevice+IdentifierAddition.h"

[[[UIDevice currentDevice] identifierForVendor] UUIDString];

But if you are implementing a system for serving advertisements, use the value in the advertisingIdentifier property of the ASIdentifierManager class instead of this property.

Felipe
  • 256
  • 1
  • 8