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
How to Remove Constraints Programmatically That Is Added from Storyboard
Undefined Symbols For Architecture Armv7
Getting Error "No Such Module" Using Xcode, But the Framework Is There
Ios Upload Image and Text Using Http Post
Seeing Black Bars At the Top and Bottom of the Iphone X Simulator
Programmatically Add Custom Event in the Iphone Calendar
Swift 2.0 - Binary Operator "|" Cannot Be Applied to Two Uiusernotificationtype Operands
How to Completely Uninstall Xcode and Clear All Settings
Swift Tableview in a Uiview Not Displaying Data
How to Size a Uitextview to Its Content
Can You Animate a Height Change on a Uitableviewcell When Selected
How to Use Nsjsonserialization
Fatal Error: Unexpectedly Found Nil While Unwrapping an Optional Values
Objective-C and Swift Url Encoding
Change Paid App to Free But Know If User Previously Purchased It