Previous answers to the question of how to get the phone number involved using NSUserDefaults and SBFormattedPhoneNumber, but apparently this doesn't work anymore since iOS 4.
So I'm looking for alternative solutions, I've seen mention of using IOKit but can't find any details.
Does anybody know a reliable way to get the phone number (and by reliable I don't mean the hack to try and search the contacts for the owner's contact info).
P.S.
I am already aware that the app will be rejected by Apple: but this is not for an App Store app.
There is not a way to do this. You can see from these questions:
Is it possible to get iphone's phone number programmatically in 2011?
Programmatically get own Phone Number in iPhone OS 4.0
Programmatically get own phone number in iOS
You can however get a contact's phone number. You can figure out how to do this from here.
Related
This question already has answers here:
Programmatically get own phone number in iOS
(9 answers)
Closed 5 years ago.
I have been looking a bit around for a way to retrieve the phone number of an iOS device but without too much sucess as I've seen mixed reports
According to this link it's a no :
Programmatically get own phone number in iOS
Also here https://www.npmjs.com/package/cordova-plugin-sim
I don't see any information about the phoneNumber for iOS.
However, as these links aren't brand new, I would like know if things have changed since
You can't. You should ask user for phone number from UI.
First of All, its impossible to get Phone number in iOS programatically. iOS don't allow such things. You can get the carrier name of the mobile number.
If you really want to get the Mobile Number, then you have to ask the user to send a message on a number which will be configured with your backend service. Once the message reaches to the number in Your backend System , you can get the mobile number from the backend with a Service call.
NO, this not possible as Apple wants to respect the privacy of their users. You can't access the phone number from public API, so you cannot.
Am I correct that with a address book permission we should be able to pretty reliably get a users phone number if they have given address book permissions via the new "My Card" contact that seems to be automatically added to your addressbook when you download IOS9?
I always wanted to do a find friends but i did not want to force users to type/verify their number....this seems to be a solid work around for ios9 users.
I am currently dealing with the same issue but unfortunately it seems that this is not possible according to Apple.
"Presuming that you’re working on iOS, there’s no programmatic way to identify the ‘me’ card. If you need to know, ask the user."
source: https://forums.developer.apple.com/thread/37564
I need to get the IMEI number and serial number of the SIM card in iOS, i have done this in android using the telephonymanager, but how can i achieve this on iOS?
I need this value because I save it in a data base using a web service, each time a client attemp to log in, so it doesnt matter if the client changes celphone or not, the account will be the same because the SIM card will be the same one.
I have been searching on the web, and found a way with this:
NetworkController.m
But it seems like this class has been removed from the web. Another possible way to achieve my goal is to use:
UIDevice-IOKitExtensions.m
But no documentation is given. Any ideas?
Does apple accepts an app using private framework?
Apple does not allow the use of private framework / api. Also, getting the users IMEI number will cause Apple to reject the app.
Is there a way through addressbookUi framework to get only the contacts who own an iDevice? The check for example is done in the messages app for iMessage. But is this available for developers? Or is there another way to check for this? Thank you in advance..
You could check, for each address book record, if there is a phone number of type "iPhone" (represented by the constant kABPersonPhoneIPhoneLabel). There's really no way of knowing for sure which of the contacts "owns an iDevice" anyway, but if there is an iPhone number for them in the address book record, then there's a good chance of them using an iPhone. Of course, it's another story altogether how that information got in your address book, and whether it is reliable.
No there isn't... The SMS app would be checking with apples servers to see if the phone number is registered with iMessage or not.
This is not a publicly accessible API.
I guess you could hash then send the users number to your own remote database and then compare contact numbers in another users address book against your database to see if they are users of your app... It's not really what you asked to do but it's the closest solution I could think up
I know this was not possible before, but I was wondering if there was any way possible to programmatically retrieve the device's phone number in the new update. I know that they added a lot of new features regarding your contacts information, but I want to know my own phone number in my app.
If you are refering to the "Mango" update then no. This information is not available.
There are no public details about what will be available in future updates.