Reputation: 6668
I am checking if an app has permission to use the camera with:
let authStatus = AVCaptureDevice.authorizationStatusForMediaType(AVMediaTypeVideo)
If the authorization status is denied (perhaps the user accidentally did not allow permission the first time when asked), is it possible to show the permission request again?
If authorization has been denied, I am attempting to request permission with:
AVCaptureDevice.requestAccessForMediaType(AVMediaTypeVideo,
completionHandler: { (granted:Bool) -> Void in
if granted {
dispatch_async(dispatch_get_main_queue()) {
self.shootPhoto(UIButton())
}
}
})
But no request for permission is dialog is presented. Does requestAccessForMediaType
only work if the authorization status is undetermined?
Upvotes: 2
Views: 955
Reputation: 263
No this is not possible. In this situation, you will need to explain to the user how to go into Settings and change the permissions.
Upvotes: 1