0

I want to get my phone number. with the coding in iphone is their any way or code to get my phone number.

I am using following code for the finding of my phone number but i am getting 1(1234)12345 In simulator it is giving null value.

NSString *num = [[NSUserDefaults standardUserDefaults]stringForKey:@"SBFormattedPhoneNumber"];

Is their any other framework to include in my application.

darioo
  • 46,442
  • 10
  • 75
  • 103
  • I think the method you are using is returning the phone number that was entered at the time of activation with iTunes. I dont know if you can get the "Sim Card" phone number. – diagonalbatman Jan 07 '11 at 13:40

2 Answers2

0

Read this post - the following code snippet should help?

NSString *num = [[NSUserDefaults standardUserDefaults]
                 stringForKey:@”SBFormattedPhoneNumber”];

NSLog(@”Phone Number: %@”, num);
Community
  • 1
  • 1
petert
  • 6,672
  • 3
  • 38
  • 46
0

As I understand it, the developer license forbids access to the SIM number. The best you can do is get the number entered to activate iTunes.

Andy
  • 2,764
  • 6
  • 24
  • 33