I am building an IOS6 app which requires the user's phone number,

Is there a way to ask the user for permission and get the number in programmatic way?

Or he has to manually type it in?

I am using Xcode 4.5 if it matters..

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top