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