0

all I'm developing app and it contains function which gets phone number and email from device. I've looked at some samples on internet but all of them are about unique id. How can i get phone number and email from device? Is there anybody who has experience in this area?

AntonKolya
  • 87
  • 1
  • 9
  • 1
    Maybe you want the [Contacts framework](https://developer.apple.com/library/ios/documentation/Contacts/Reference/Contacts_Framework/)? – jtbandes Jan 09 '16 at 06:24
  • Also see http://stackoverflow.com/questions/9409275/ios-how-to-get-owners-email-address – rmaddy Jan 09 '16 at 06:33

2 Answers2

2

Apple has removed access to this data from inside your app. You may not access the user's phone number from the device. You instead must require them to enter it in a text field or something.

"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.

modesitt
  • 7,052
  • 2
  • 34
  • 64
  • IMO does pre-fill phone number textfield : https://itunes.apple.com/fr/app/imo-appels-vid%C3%A9o/id336435697?mt=8 Any idea how ? – BoilingLime Apr 23 '18 at 08:58
0

This is not possible from the iOS APIs, you will need to query the user for phone number or discover it through other means.

Ogre Codes
  • 18,693
  • 1
  • 17
  • 24