2

I am developing an iPhone application for jail broken phones and in this application I would like to fetch user's phone number.

I have gone through the entire stackoverflow.com and found some relevant answers but all of them are obsolete and doesn't work with iOS 4.0 anymore.

The most famous solution for this problem is

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

but as I mentioned this solution no more works with iOS 4.0

As my application is intended towards the jail broken phones and not intended the Apple app store so I am not worried about my app rejection, hence any private API will also work for me.

Also please let me know if we can fetch IMSI number from SIM using any private APIs of iPhone

Cœur
  • 32,421
  • 21
  • 173
  • 232
sandy
  • 2,097
  • 4
  • 28
  • 49
  • 1
    If this can be made to work, it is a good argument against jail breaking your iPhone. – JeremyP Dec 28 '10 at 16:45
  • Agreed! Jailbreaking pretty much opens up the kinds of calls that facilitate spyware, malware and adware. Not that approved apps can't pull certain data, but it certainly makes the job harder. – Alex Reynolds Jan 04 '11 at 10:36
  • Possible duplicate of [iOS 7: How to get own number via private API?](https://stackoverflow.com/questions/19504478/ios-7-how-to-get-own-number-via-private-api) – Cœur May 17 '18 at 12:13

2 Answers2

1

If you're targeting jailbroken phones, you might take a look at the CoreTelephony framework. I don't often work with private APIs, so no guarantees this particular framework makes the phone number available to you, but you might get lucky.

Alex Reynolds
  • 91,635
  • 50
  • 223
  • 320
  • I have already gone through the CoreTelePhony framework but couldn't find any appropriate API which is meant for this purpose – sandy Dec 28 '10 at 09:12
  • Core Telephony is Apple supported. It can only be used to work with ongoing calls and the carrier information/features available like VoIP, etc. – Saurabh G Dec 28 '10 at 15:46
  • Thanks for giving me the right direction. A looked closely into the CoreTelephony APIs and found some private methods to achieve the same. – sandy Jan 04 '11 at 07:24
  • @Saurabh There are hundreds of private methods are available in Core Telephony which can help to gain so many things like Phone number, IMEI etc. – sandy Jan 04 '11 at 07:35
1

Officially, it's not supported, nor is it recommended to get the user's personal information programmatically.

Also, the SDK does not yet provide any mechanism to work with information in the SIM.

Saurabh G
  • 1,885
  • 14
  • 15
  • As I have already mentioned in my post that my app not is intended for app store submission, hence I am not concerned about whether it is official or unofficial, the matter of fact is there are 1000s of APIs which are hidden underneath of the SDK which we need to explore. – sandy Jan 04 '11 at 07:38