Contact Address Book Crash on iOS 10 Beta

Contact Address book crash on iOS 10 beta

The Address Book API was deprecated in iOS 9 in favor of the more object-oriented Contacts Framework.

Instead of using the ABPeoplePickerViewController, move to CNContactPickerViewController.

Why do the deprecated ABAddressBook APIs crash iOS 10?

I recently dealt with this myself. The problem has to do with permissions.

Make sure you call ABAddressBookGetAuthorizationStatus() and if the result is kABAuthorizationStatusNotDetermined then you must call ABAddressBookRequestAccessWithCompletion and make use of the completion handler. Only use other address book APIs (including the people picker) after your app has been granted permission.

Attempts to use ABPeoplePickerNavigationController to allow a user to select a contact's property without first ensuring your app has permission to access the address book will result in the error posted in your question.

CNPropertyNotFetchedException App Crashed

You're requesting keys

• CNContactIdentifierKey
• CNContactFormatter.descriptorForRequiredKeys(for: .fullName)

…but then you're trying to access contact.phoneNumber.

You can only access keys specified in keysToFetch, so you need to add CNContactPhoneNumbersKey to that array

App crash when change permission AddressBook in Settings

Your app is not crashing its just forced to restart by iOS with new privacy settings. So when you change the privacy policy, app will be killed if its attached to debugger else it will restart or relaunch.

Note : If the user at some point changes the Address Book, Calendars, Reminders, Camera, or Photos permissions, iOS will SIGKILL the app. (It's not crash it's default behaviour of iOS)



Related Topics



Leave a reply



Submit