Addressbook authorizated

142 views Asked by At

in my app import contacts, but for authorize the user use:

log is empty. what is the error? solution?

var error:Unmanaged<CFErrorRef>? = nil
let addressBook: ABAddressBookRef?
let status = ABAddressBookGetAuthorizationStatus()

if status == ABAuthorizationStatus.NotDetermined {
    ABAddressBookRequestAccessWithCompletion(addressBook) {
        (success, error) in
        if success {
            //code
            NSLog("OK")
        }
        else {
            NSLog("NO")
        } 
    }
    if status == ABAuthorizationStatus.Authorized {
        picker.peoplePickerDelegate = self
        presentViewController(picker, animated: true, completion: nil)
        NSLog("OK")
    }
    else {
        NSLog("NO")
    }
}
0

There are 0 answers