ios - Finding owner's phone number in 2014? -


this question has answer here:

i've been researching how find owner phone number of ios device, no luck. there post around showing thirdparty frameworks allow that, rejected apple.

in app i'm accessing addressbook contact , getting phone contacts, name , phone. in case (with iphone, didn't test in other iphones) can see own number listed rest of contacts. there way find out/flag or recognize contact owner of iphone?

here code:

abaddressbookref addressbookref = abaddressbookcreatewithoptions(null, null);      if (abaddressbookgetauthorizationstatus() == kabauthorizationstatusnotdetermined) {         abaddressbookrequestaccesswithcompletion(addressbookref, ^(bool granted, cferrorref error) {             abaddressbookref addressbook = abaddressbookcreate( );         });     }     else if (abaddressbookgetauthorizationstatus() == kabauthorizationstatusauthorized) {   cferrorref *error = null;         abaddressbookref addressbook = abaddressbookcreatewithoptions(null, error);         cfarrayref allpeople = abaddressbookcopyarrayofallpeople(addressbook);         cfindex numberofpeople = abaddressbookgetpersoncount(addressbook);          for(int = 0; < numberofpeople; i++) {              abrecordref person = cfarraygetvalueatindex( allpeople, );               nsstring *firstname = (__bridge nsstring *)(abrecordcopyvalue(person, kabpersonfirstnameproperty));              nsstring *lastname = (__bridge nsstring *)(abrecordcopyvalue(person, kabpersonlastnameproperty));                nslog(@"name:%@ surname: %@", firstname, lastname);               abmultivalueref phones = abrecordcopyvalue(person, kabpersonphoneproperty);              for(cfindex j = 0; j < abmultivaluegetcount(phones); j++)             {                 cfstringref phonenumberref = abmultivaluecopyvalueatindex(phones, j);                 cfstringref loclabel = abmultivaluecopylabelatindex(phones, j);                 nsstring *phonelabel =(__bridge nsstring*) abaddressbookcopylocalizedlabel(loclabel);                  nsstring *phonenumber = (__bridge nsstring *)phonenumberref;                 cfrelease(phonenumberref);                 cfrelease(loclabel);                 nslog(@" - %@ (%@)", phonenumber, phonelabel);              }          } 

the phone number not accessible apple public api means can't it.

if implementing dialer application can't see nee own phone number for. it's not going call yourself?

or

you can users phone number nsuserdefault:

that jailbroken devices. should not use these codes if want app uploaded appstore.

[[nsuserdefaults standarduserdefaults] objectforkey:@"sbformattedphonenumber"] 

but work if user has entered phone number. there no way in official sdk read sim card.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -