How to get own mobile number from the iOS Device programmatically?
20,632
Solution 1
The phone number is not accessible from any Apple public API which means you can't get it.
Solution 2
The mobile number cannot be accessed without using any private API using which would lead to app rejection. link
Solution 3
This is not possible to get phone number of the device
Refer this link
Programmatically get own phone number in iOS
Get the device's phone number programmatically
![Gopal Devra](https://i.stack.imgur.com/Ct1JR.jpg?s=256&g=1)
Author by
Gopal Devra
Currently a Software Engineer at Hughes Systique Private Limited. https://twitter.com/gopal_devra #SOreadytohelp
Updated on May 18, 2020Comments
-
Gopal Devra about 4 years
I want to get my own contact number for my app.
I have read some answers on the stack overflow but those were old.
So please let me know according to new guidelines of Apple, can we get mobile number?
-
Gopal Devra over 7 yearsI read this link stackoverflow.com/questions/19504478/… but as suggested that app must be rejected that is why I am asking for.
-
aqavi_paracha over 5 yearsIt's now possible in Xcode - check this - stackoverflow.com/a/54004224/536214
-
Vishnu Kumar. S over 5 years@aqavi_paracha: It's not possible, the link you shared above shows how to set the content type for UITextField. It doesn't mean that you can fetch the phone number from the device. Apple won't let you to do so :)
-
aqavi_paracha over 5 years@VishnuKumar.S . Yeah but when you set contentType to Mobile field, iOS gives you option to select Mobile number in mobile field, like we used to do in Web. So basically you get mobile number of the phone you're using the app in.
-
KoreanXcodeWorker about 5 yearsIn this case, 'This' should be 'It'.