https://stackoverflow.com/questions/39631256/request-permission-for-camera-and-library-in-ios-10-info-plist/39631642
https://stackoverflow.com/questions/33866135/swift-ios-9-app-not-in-settings
Camera :
Key : Privacy - Camera Usage Description
Value : $(PRODUCT_NAME) camera use
// Check status
let authStatus = AVCaptureDevice.authorizationStatusForMediaType(AVMediaTypeVideo)
switch authStatus {
case AVAuthorizationStatus.Authorized:
print("AVAuthorizationStatus.Authorized")
case AVAuthorizationStatus.Denied:
print("AVAuthorizationStatus.Denied")
case AVAuthorizationStatus.NotDetermined:
print("AVAuthorizationStatus.NotDetermined")
case AVAuthorizationStatus.Restricted:
print("AVAuthorizationStatus.Restricted")
default:
print("AVAuthorizationStatus.Default")
}
// Request permission
AVCaptureDevice.requestAccess(for: AVMediaType.video) { response in
if response {
//access granted
} else {
}
}