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 ?
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 ?