Pop for request access to contacts not show ios 9 -


i'm fetching contacts address book popup not show ask permission access contacts. automatically denied when try same code in demo run ddi not run in app. have read many articles did not solution. i'm missing in plist or settings.

cncontactstore * contactstore = [[cncontactstore alloc]init];      if ([cncontactstore authorizationstatusforentitytype:cnentitytypecontacts] == cnauthorizationstatusnotdetermined) {         [contactstore requestaccessforentitytype:cnentitytypecontacts completionhandler:^(bool granted, nserror * __nullable error) {              if (granted==yes)             {               }             else             {                 nslog(@"error");             }         }];     } 

or second methods

 cferrorref error = nil;     abaddressbookref addressbook = abaddressbookcreatewithoptions(null, &error);      if (abaddressbookgetauthorizationstatus() == kabauthorizationstatusnotdetermined) {      abaddressbookrequestaccesswithcompletion(addressbook, ^(bool granted, cferrorref error)      {          if (error)          {              nslog(@"error %@", error);          }          else if (granted)          {  }          cfrelease(addressbook);      });      } 

i had issue today, , deleted keys info.plist:

<key>cfbundledisplayname</key> <string></string> <key>lsapplicationcategorytype</key> <dict/> <key>cfbundlegetinfostring</key> <string></string> 

it works now. wired case.


Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -