[TIMOB-27805] Open Photo Gallery not requiring permissions
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Not Our Bug |
Resolution Date | 2020-03-16T18:43:17.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | iOS |
Labels | n/a |
Reporter | Ray Belisle |
Assignee | Vijay Singh |
Created | 2019-12-06T22:24:19.000+0000 |
Updated | 2020-03-16T18:43:22.000+0000 |
Description
When requesting access to the user's photo gallery on iOS, the app should not allow the gallery to display if permission has not been granted.
Simple test:
index.js
Titanium.Media.openPhotoGallery({
success: function (event) {
// alert( 'libraryHandler success: ' + JSON.stringify( event, null, 2 ) );
_params.event = event;
processImage(_params, false);
},
error: function (event) {
alert('libraryHandler error: ' + JSON.stringify(event, null, 2));
Titanium.API.info('Sending file error');
Titanium.API.info(event);
},
mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO],
allowEditing: true
});
The photo gallery will display and you can select a photo and get a successful result.
Hello [~raybelisle], Thanks for reporting this issue. Can you please share us the steps to reproduce the issue? Did you check the issue on your physical device? Also, please try to check this issue on latest SDK 8.3.0.GA and add the following permission code on tiapp.xml file under
Thanks
As per [Apple doc](https://developer.apple.com/documentation/photokit/requesting_authorization_to_access_photos?language=objc) - "When using the UIImagePickerController to bring up the user's photo library, your app doesn't need to request permission explicitly." In titanium, UIImagePickerController is used to access user's photo gallery. I tested this on different iOS versions in native iOS app and behavior is as below - In iOS 10.x, it is mandatory to use the mentioned key otherwise it will crash. In iOS 11.0+, it is not mandatory to use. So mentioned issue is not an issue in titanium. It is similar behavior to native. If it is required to check for user's permission please use [requestPhotoGalaryPermissions](https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Media-method-requestPhotoGalleryPermissions)