void CheckDeviceAuthorizationStatus ()
{
var status = AVCaptureDevice.GetAuthorizationStatus (AVMediaType.Video);
switch (status) {
// The user has previously granted access to the camera
case AVAuthorizationStatus.Authorized:
break;
// The user has not yet been presented with the option to grant video access.
// We suspend the session queue to delay session running until the access request has completed.
// Note that audio access will be implicitly requested when we create an AVCaptureDeviceInput for audio during session setup.
case AVAuthorizationStatus.NotDetermined:
sessionQueue.Suspend ();
AVCaptureDevice.RequestAccessForMediaType (AVMediaType.Video, granted => {
if (!granted)
setupResult = SetupResult.CameraNotAuthorized;
sessionQueue.Resume ();
});
break;
default:
// The user has previously denied access
setupResult = SetupResult.CameraNotAuthorized;
break;
}
}