IOS7 get the native number

Source: Internet
Author: User

Before online popular two ways to get the iphone native number:

1. Read the user-set number

NSString *num = [[Nsuserdefaults standarduserdefaults] Stringforkey:@ "sbformattedphonenumber" ];

2. Private API, requires coretelephony.framework support

extern nsstring* Ctsettingcopymyphonenumber (); -(NSString *) phonenumber {    *phone = ctsettingcopymyphonenumber ();     return phone;}

However, 1 of the way has expired, and 2 of the way has not been the value. Later on Google Baidu a lot of laps, finally found the method:

3. Read the plist file

@" /private/var/wireless/library/preferences/com.apple.commcenter.plist "  *dict =*phonenumber = [dict valueforkey:@ "phonenumber"]; NSLog ([NSString stringWithFormat:@ "Phone Number:%@", Phonenumber],nil);

Of course, see the Code also know, need to jailbreak machine. The Apple pp Helper can read to the native number after connecting the iphone via the data cable, no jailbreak required and I don't know the way.

Want to know can give me say, (*^__^*) hehe ....

IOS7 get the native number

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.