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
Add Uitapgesturerecognizer to Uitextview Without Blocking Textview Touches
How to Create an Nsdecimal Without Using Nsnumber and Creating Autoreleased Objects
Initwithstyle:Reuseidentifier: Not Called
How to Control Avassetwriter to Write at the Correct Fps
Swipe to Go Back Only Works on Edge of Screen
Fontawesome Pro and Xamarin.iOS Only One Font Can Be Active
API Facebook iPhone , Possible to Post to a Friend's Wall
Make Navigationbar's Titleview Larger Than Itself
Supporting Multiple Screen Sizes in Storyboards (3.5 and 4 Inch Screens)
iPhone Camera, How to Avoid Cameraoverlay on Preivew View; How to Know When Entering Preview View
Load a .Tmx (Tiled Map) in Sprite Kit
Swift Dynamic Table Cell Height
Pull Notification Locally on Jailbroken Device
Healthkit Authorisation Status Is Always 1
Keep Bluetooth Sound When Initializing Avaudiosession
Swipe Left or Right to Load the View Controller with the Collection View Cell Highlight