Created
May 6, 2015 02:09
-
-
Save srkirkland/477f174cc0152b3c9e0b to your computer and use it in GitHub Desktop.
request and check for camera access
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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