Skip to content

Instantly share code, notes, and snippets.

@srkirkland
Created May 6, 2015 02:09
Show Gist options
  • Save srkirkland/477f174cc0152b3c9e0b to your computer and use it in GitHub Desktop.
Save srkirkland/477f174cc0152b3c9e0b to your computer and use it in GitHub Desktop.
request and check for camera access
var status = AVCaptureDevice.GetAuthorizationStatus (AVMediaType.Video);
if (status == AVAuthorizationStatus.Authorized) {
//yay
} else if (status == AVAuthorizationStatus.NotDetermined) {
AVCaptureDevice.RequestAccessForMediaType (AVMediaType.Video, (bool accessGranted) => {
if (accessGranted) {
//yay
} else {
//boo
}
});
} else {
//boo
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment