I need to invite users to change camera permissions for my application through UIAlertController. A warning has the following effect:
alert.addAction(UIAlertAction(title: "Open Settings", style: .default, handler: { (action) -> Void in
guard let settingsUrl = URL(string: UIApplicationOpenSettingsURLString) else {
return
}
if UIApplication.shared.canOpenURL(settingsUrl) {
DispatchQueue.main.async(execute: {
UIApplication.shared.openURL(settingsUrl)
})
}
}))
This works because it opens the settings, but if the user changes the resolution of the camera, the application crashes in the background with Message from debugger: Terminated due to signal 9
.
Now they can open the application, and permission is correct, but they should start from the very beginning. Does anyone know how to solve this?
James source
share