Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

diyora

macrumors newbie
Original poster
Jul 21, 2008
25
0
Hello all,
I want iPhone serial number.For that i use UIDevice class.In this uniqueIdentifier i use for that.I get number but it is different.How i get correct serial number.Is there any conversion required.

Thank you..
 
Thanks,
But i want serial number programatically.

Thank you...
 
Thanks for all your reply...
As i required serialNo when i code run on iPhone.
For that is use NSString *deviceId = [[UIDevice currentDevice] uniqueIdentifier];
But this deviceId is not same as serialNo as given behind the iPhone.

Thank you...
 
the way I said will work.

Plug into iTunes and click on the word "Serial Number (or phone number)" until the word "Identifier" comes up.

thats what youre looking for.


if you just want the SERIAL, you can go to settings and about on the phone itself.
 
this things i check early.
As in UIDevice documentation said uniqueIdentifier provide serialNo.So i try this for get serialNo.But it provide identifier.How i get serialNo programatically.

Thank you..
 
I don't think UIDevice gives access to the actual serial number. All you can get is the UDID, which is the value you already mentioned, which is a hash of something like the serial number and hardware identifiers I think. It is indeed a unique value though, no 2 phones will have the same UDID. For what possible reason would your app need the phone's actual serial number?
 
Here is the answer to your question

http://www.timeister.com/2009/06/objective-c-get-iphone-number/

Code:
UIDevice *device = [UIDevice currentDevice];
NSString *uniqueIdentifier = [device uniqueIdentifier];
[device release];
NSLog(@”Device GUID: %@”, uniqueIdentifier);

--------
Adrian:)


Hello all,
I want iPhone serial number.For that i use UIDevice class.In this uniqueIdentifier i use for that.I get number but it is different.How i get correct serial number.Is there any conversion required.

Thank you..
 
Hi pirvulescu,

Code:
UIDevice *device = [UIDevice currentDevice];
NSString *uniqueIdentifier = [device uniqueIdentifier];
[device release];
NSLog(@”Device GUID: %@”, uniqueIdentifier);
I try out this early.

I again tell this gives the deviceId. It is different from serial number.

Thank you.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.