开发者

How can I get the phone number of my iPhone device? [duplicate]

This question already has answers here: Closed 11 years ago.

Possible Duplicate:

Progra开发者_如何学编程mmatically get own phone number in iPhone OS

I am new in iPhone technology. I am currently building a dialler application in which requires the phone number of my iPhone form my SIM card.

How can I get the phone number of my iPhone device?


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

If you are implementing a dialer application I can't see what you would nee the own phone number for. It's not like you are going to call yourself?


You can get the users phone number from the NSUserDefault:

[[NSUserDefaults standardUserDefaults] objectForKey:@"SBFormattedPhoneNumber"]

But this will only work if the user has entered his phone number. There is no way in the official SDK to read anything from the SIM card.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜