Hi friends.
can anyone tell me the way for getting the serial number of an iPhone (not the UDID).
any immediate help will be appreciated..
Hi friends.
can anyone tell me the way for getting the serial number of an iPhone (not the UDID).
any immediate help will be appreciated..
Code example (this might be outdated) using a non-public API:
http://www.iphonedevforums.com/forum/sdk-coding-help/145-unique-identifier-iphone.html
@implementation AppLib
...
- (NSString*)getSerialNumber
{
CFTypeRef serialNumberAsCFString;
io_service_t platformExpert = IOServiceGetMatchingService(
kIOMasterPortDefault, IOServiceMatching("IOPlatformExpertDevice"));
if (platformExpert)
{
serialNumberAsCFString = IORegistryEntryCreateCFProperty(
platformExpert, CFSTR(kIOPlatformSerialNumberKey),
kCFAllocatorDefault, 0);
}
IOObjectRelease(platformExpert);
NSString *serial =
[[NSString alloc] initWithFormat:@"%@",serialNumberAsCFString];
return serial;
}
Ready to use category on UIDevice: UIDevice+serialNumber. Not sure this would be accepted on the App Store.