Reputation: 1334
I have an app with camera access.
It was working as needed until recent times.
May be it is related to iOS10...
So, here is how I ask user for camera access:
- (void)checkCameraAuthorization {
AVAuthorizationStatus status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
switch (status) {
case AVAuthorizationStatusAuthorized: {
break;
}
case AVAuthorizationStatusNotDetermined: {
dispatch_suspend(self.sessionQueue);
[AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
// never gets here
dispatch_resume(self.sessionQueue);
}];
break;
}
default: {
// denied or restricted;
isAccessible = NO;
[self inaccessibleCameraExit];
break;
}
}
}
As I've said this code worked some time ago.
Now, it throws an exception after AVCaptureDevice requestAccessForMediaType:
being executed.
If I comment out the call to this method, everything works except camera certainly.
Exception is not pointing to my code and not in my thread.
So, can you please help me to return camera to working state.
Upvotes: 0
Views: 77