When my app tries to access the camera for the first time on iOS 8, the user is presented with a camera permission dialog, much like the microphone one for microphone access
I'm running into a similar issue, if the user has denied camera access when they are first prompted, pressing the button to take a snap shot results in a black screen in the camera mode.
However i want to detect that the user has declined access and prompt them it must be turned on but i can't find any functions to check the current user camera access, is there such a function?
EDIT: The following check will let you know in IOS 8 about camera access:
#import
AVAuthorizationStatus status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
if(status == AVAuthorizationStatusAuthorized) { // authorized
}
else if(status == AVAuthorizationStatusDenied){ // denied
}
else if(status == AVAuthorizationStatusRestricted){ // restricted
}
else if(status == AVAuthorizationStatusNotDetermined){ // not determined
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
if(granted){ // Access has been granted ..do something
} else { // Access denied ..do something
}
}];
}
This information was found on the following question (How to know that application have camera access or not programmatically in iOS8):