I ask the user for contacts permission before going into a "import contacts" view controller. When I tap yes for the permission request, the app halts for about 5-10 seconds and then proceeds with the segue. During that frozen time, it does not allow any user interaction or anything else to progress.
The action taken upon approval is at
NSLog(@"Just authorized");
[self.navigationController pushViewController:vc animated:YES];
- (void)getAddressBookPermission:(EIConnectionsImportContactsTableViewController *)vc {
if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusDenied ||
ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusRestricted){
//1
UIAlertView *permissionDeniedAlert = [[UIAlertView alloc] initWithTitle:@"Sorry" message:@"Permission Denied - We're unable to import contacts from your phone unless you provide approval." delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];
[permissionDeniedAlert show];
} else if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusAuthorized){
//2
[self.navigationController pushViewController:vc animated:YES];
} else { //ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined
ABAddressBookRequestAccessWithCompletion(ABAddressBookCreateWithOptions(NULL, nil), ^(bool granted, CFErrorRef error) {
if (!granted){
//4
UIAlertView *permissionDeniedAlert = [[UIAlertView alloc] initWithTitle:@"Sorry" message:@"Permission Denied - We're unable to import contacts from your phone unless you provide approval." delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:nil];
[permissionDeniedAlert show];
return;
}
NSLog(@"Just authorized");
[self.navigationController pushViewController:vc animated:YES];
});
}
}
Any identifiable reason for the standstill?