Programmatically Get Own Phone Number in Ios

Programmatically get own phone number in iOS

At the risk of getting negative marks, I want to suggest that the highest ranking solution (currently the first response) violates the latest SDK Agreement as of Nov 5, 2009. Our application was just rejected for using it. Here's the response from Apple:

"For security reasons, iPhone OS restricts an application (including its preferences and data) to a unique location in the file system. This restriction is part of the security feature known as the application's "sandbox." The sandbox is a set of fine-grained controls limiting an application's access to files, preferences, network resources, hardware, and so on."



The device's phone number is not available within your application's container. You will need to revise your application to read only within your directory container and resubmit your binary to iTunes Connect in order for your application to be reconsidered for the App Store.

This was a real disappointment since we wanted to spare the user having to enter their own phone number.

How to get own mobile number from the iOS Device programmatically?

The phone number is not accessible from any Apple public API which means you can't get it.

Get the device's phone number programmatically

No, the device's phone number is not available programmatically and still be approved by Apple, thankfully. I definitely don't want some free app I download out of curiosity to grab my phone number and start sending me spam SMS messages or have marketers calling me.

Programmatically get own Phone Number in iPhone OS 4.0

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.

How to get My Number from AddressBook framework ?

This is not allowed. There is no public API to get user's phone number.
There are few open question on SO that cover this theme. For example this.



Related Topics



Leave a reply



Submit