So basicly the app requests for two permissions, for camera and access to photo library. The camera is an AR camera, i can trigger that by having a scene with the camera in it and load it at the beginning. The photo library permission popup comes up when i save a picture. The question is how can i trigger the photo library permission without having to save an image.
Thanks in advance.
Fixed it:
Add the following in the main method in the main.mm file in XCode:
PHAuthorizationStatus status = [PHPhotoLibrary authorizationStatus];
if (status == PHAuthorizationStatusAuthorized) {
// Access has been granted.
}
else if (status == PHAuthorizationStatusDenied) {
// Access has been denied.
}
else if (status == PHAuthorizationStatusNotDetermined) {
// Access has not been determined.
[PHPhotoLibrary requestAuthorization:^(PHAuthorizationStatus status) {
if (status == PHAuthorizationStatusAuthorized) {
// Access has been granted.
}
else {
// Access has been denied.
}
}];
}
else if (status == PHAuthorizationStatusRestricted) {
// Restricted access - normally won't happen.
}