Tuesday, 20 November 2012

Programmatically Request Access to Contacts in iOS 6


Reference: http://stackoverflow.com/questions/12570774/cant-access-contacts-sources-on-device-in-ios-6


+ (BOOL)contactsServicesEnabled
{
   
   
    if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined) {
        return YES;
    }
    else if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusAuthorized) {
        return YES;
    }
    else {
        return NO;
    }

}

No comments:

Post a Comment