App crashes on enabling Camera Access from Settings iOS 8 App crashes on enabling Camera Access from Settings iOS 8 ios ios

App crashes on enabling Camera Access from Settings iOS 8


The first time you access the Camera the OS will automatically show the permission prompt. Whether the user allows or denies the prompt, your app will continue running. If the user at some point changes the Address Book, Calendars, Reminders, Camera, or Photos permissions, iOS will SIGKILL the app. It takes this action to ensure that the app no longer has any previously authorized data in its possession. When the user moves from the Settings app back to the third-party app, it launches from scratch and now has the Denied authorization status. As a result of this behavior, I have two recommendations:

  1. Detect when the permission is denied and present some UI that explaining that the user needs to toggle the Settings app permission. In iOS 8 you can take them directly to your app's entry with [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]].

  2. Implement some sort of state restoration so that when the app is terminated and relaunched it will return the user to the view/feature that was previously visible.

Source (requires developer account)


Your recommendations are correct. I present an alert view asking the user to go to the Settings app to change camera and contacts permission if they previously denied them. The problem for me is with your #2 recommendation. I am deep inside a sign up process and have collected sign up information such as name, email, date of birth. Then I have a "Request for Permissions" screen. When the app is relaunched after it's killed, I don't have this signup info anymore. I guess, I can save the signup info (to the phone) before presenting the alert view, then upon relaunch of the app, check if there is any previously stored sign up info. If so, go back to the screen which asked for permissions, then delete the stored sign up info.