iOS Question PlistExtra and CNContactStore...

Pascal34

Member
Licensed User
Longtime User
Hello

using CNContactStore with IOS 9 runs well.

With IOS 10 it seems i need a static declaration of needs to be allowed.

Something like this dont seems effective with IOS 10

CNAuthorizationStatus status = [CNContactStore authorizationStatusForEntityType:CNEntityTypeContacts];
if( status == CNAuthorizationStatusDenied || status == CNAuthorizationStatusRestricted)
{
NSLog(@"CNContactStore > access denied");
return NO;
}
if( status == CNAuthorizationStatusNotDetermined )
{
CNEntityType entityType = CNEntityTypeContacts;

CNContactStore *contactStore = [[CNContactStore alloc] init];
[contactStore requestAccessForEntityType:entityType completionHandler:^(BOOL granted, NSError * _Nullable error) {
if(granted){
NSLog(@"CNContactStore - access granted OK");
}
}];
}


I try to add an header:

#PlistExtra: <key>CNContactStore</key><string>Contacts access</string>

In

#Region Project Attributes
#ApplicationLabel: xxxx
#Version: 1.0.4
#iPhoneOrientations: Portrait
#Target: iPhone
#MinVersion: 9
#PlistExtra: <key>CNContactStore</key><string>Contacts access</string>


#End Region



It seems that not good enough.

any idea ?
 

Pascal34

Member
Licensed User
Longtime User
In fact your post what a good source, i just need :

#PlistExtra:<key>NSContactsUsageDescription</key><string>Gestion des contacts.</string>

So now it runs for me even for IOS 10 :)
 
Upvote 0
Top