Home > iPhone SDK > Objective C Get iPhone number

Objective C Get iPhone number

How to get the iphone number from sim using xcode or objective c?

NSString *num = [[NSUserDefaults standardUserDefaults] stringForKey:@”SBFormattedPhoneNumber”];
NSLog(@”Phone Number: %@”, num);

Bookmark and Share
Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Blogosphere News
  • LinkedIn
  • Live
  • MySpace
  • Tumblr
  • TwitThis
  • Yahoo! Buzz
  • StumbleUpon
  • Technorati
Categories: iPhone SDK Tags: , , ,
  1. springrider
    June 30th, 2009 at 03:54 | #1

    Thanks for the tip! But I found it only works when user type there number in iTunes.
    here is the details: http://www.alexcurylo.com/blog/2008/11/15/snippet-phone-number/

  2. July 2nd, 2009 at 23:00 | #2

    NOTE:
    On the iPhone simulator you should receive a “null” value as a result for this call. The same result is obtaining if you run this code on an iPod Touch.

    ——–
    Thanks for the comment!

  1. No trackbacks yet.