4

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?

Cœur
  • 37,241
  • 25
  • 195
  • 267
Gopal Devra
  • 564
  • 2
  • 5
  • 24
  • 2
    is not possible in iOS . android we can get – Anbu.Karthik Nov 21 '16 at 11:41
  • 2
    Probably not, if you want it, ask the user to input, it's highly violated the privacy of user and Apple doesnt like it – Tj3n Nov 21 '16 at 11:41
  • 2
    Many communications apps ask for the phone number, including WhatsApp. Many also use it for verification purposes, including FB and Google. I've worked for companies with products which ask for the phone number. Apple has never indicated this as a problem. – Avi Nov 21 '16 at 11:43
  • 1
    not possible in iOS, becoz is violating the Apple policy and will be rejected by Apple for security purpose. – Sailendra Nov 21 '16 at 11:44
  • @Avi So please let me know how to get the own contact number? if you have got any reference. – Gopal Devra Nov 21 '16 at 11:47
  • @Martin R I asked this question again because that question is too old for now. Apple always updates their terms and conditions that is why I am asking this. – Gopal Devra Nov 21 '16 at 11:57
  • It is the same question and the answer is still valid. In fact you have *accepted* an answer which just *links to that Q&A* as a reference. – Martin R Nov 21 '16 at 11:58
  • @MartinR, Yes I accepted that answer according to the old references but I am still looking for the updated answer. – Gopal Devra Nov 21 '16 at 12:02
  • The answer is the same. No update necessary. – Avi Nov 21 '16 at 18:45

3 Answers3

8

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

Cœur
  • 37,241
  • 25
  • 195
  • 267
Vishnu Kumar. S
  • 1,797
  • 1
  • 15
  • 35
  • I read this link http://stackoverflow.com/questions/19504478/ios-7-how-to-get-own-number-via-private-api but as suggested that app must be rejected that is why I am asking for. – Gopal Devra Nov 21 '16 at 11:44
  • It's now possible in Xcode - check this - https://stackoverflow.com/a/54004224/536214 – aqavi_paracha Jan 02 '19 at 09:53
  • 1
    @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 :) – Vishnu Kumar. S Jan 03 '19 at 07:31
  • @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. – aqavi_paracha Jan 03 '19 at 07:57
3

The mobile number cannot be accessed without using any private API using which would lead to app rejection. link

Community
  • 1
  • 1
Md. Ibrahim Hassan
  • 5,359
  • 1
  • 25
  • 45
2

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

Community
  • 1
  • 1
VJVJ
  • 435
  • 3
  • 21