When we fill value string section in Info.plist for "Privacy - Photo Library Additions Usage Description" and as the application try to copy video file to Photo Library iOS automatically ask authorization and everything goes ok after that.
But in that case it is not enough. We would like to do things if user do not want it.
We are doing it for camera usage as following;
func checkCameraAuthorizations(){
// Checks privacy authorizations and change aplication behaviour accordingly.
if AVCaptureDevice.authorizationStatus(for: .video) == .authorized {
cameraUsageAuthorized = true
} else {
AVCaptureDevice.requestAccess(for: .video, completionHandler: { (granted: Bool) in
if granted {
self.cameraUsageAuthorized = true
} else {
self.cameraUsageAuthorized = false
}
})
}
}
We are using cameraUsageAuthorized variable in several place in application about camera usage.
But we could not find a similar function for video file copy from application document directory to Photo Library.
Also, we are filling Privacy values by hand in Info.List. Is there anyway to do it programmatically?