iPhone API get local device phone number
Here you can find how to get the iphone sim number as string
http://blog.timeister.com/2009/06/25/objective-c-get-iphone-number/
code:
NSString *num = [[NSUserDefaults standardUserDefaults] stringForKey:@”SBFormattedPhoneNumber”];
NSLog(@”Phone Number: %@”, num);
Adrian
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.
Contact numbers iphone sdk
ABMutableMultiValueRef multi;
int multiCount = 0;
multi = ABRecordCopyValue(record, kABPersonPhoneProperty);
multiCount = ABMultiValueGetCount(multi);
for (int i = 0; i < multiCount; i++) {
phoneNumber = (NSString * ) ABMultiValueCopyValueAtIndex(multi, i);
[someArray addObject: phoneNumber];
}
Can I get user's phone number by requesting for permission in ios 6?
You can't get the phone via any easy API within iOS. There might be a way to do it via the technique described in this related question, but this is a few years old and Apple may have closed this hole (which uses an undocumented key). I also wonder if Apple wouldn't allow the app on the App Store for privacy reasons. Probably not.
You'll have to trust the user to type in the correct phone number if you prompt him/her to.
Is there ANY way to get a Smart Phone number from website?
There is no reliable way to get a phone number with JavaScript without prompting the user. That is, it cannot be retrieved automatically using a browser API.
It is possible inside of certain Android / iPhone application views. See discussions here: How can I get the device's phone number through JavaScript in Android?. And here: Getting the local iPhone number through SDK
As mentioned in comments, this is not a good thing to do in general (privacy, etc.). Definitely prompt the user for input if the phone number is needed.
Using IOS SDK is it possible to detect an incoming call when another call is inprogress (in background)?
It looks like it is not possible with the current sdk.
Related Topics
How to Determine File Size on Disk of a Video Phasset in iOS8
Download PDF and Save to the "Files" in Iphone, Not to the App Data, Swift
Show Data in Uipickerview Second Component Based on First Component Selection
Nsurlcache Does Not Clear Stored Responses in iOS8
How to Solve This Exc_Bad_Access(Code=Exc_I386_Gpflt )In Swift Programming
How to Detect Fullscreen Mode Using Avplayerviewcontroller in Swift
iPhone Only App Rejected for Not Running on iPad
How to Integrate Payu Money in Swift
Swift Switch Pattern Matching with Arrays
Page Based "Reloadrootcontrollerswithnames:" on Launch Loop
Swift, Dispatch_Group_Wait Not Waiting
Displaying Text One Character at a Time in Swift 2.0
About "Slcomposeviewcontroller" in iOS 11 Beta
Synchronizing Read/Write Access to an Instance Variable for High Performance in iOS
Ios: Production Push Notifications, Invalid Token from Apns Server
Accessing Objective-C Base Class's Instance Variables from a Swift Class