[AC-5714] Ti.Media.saveToPhotoGallery crash on iOS 11.3
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Resolved |
Resolution | Invalid |
Resolution Date | 2018-04-26T15:55:38.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | n/a |
Reporter | Thomas Lemaitre |
Assignee | Shak Hossain |
Created | 2018-04-26T15:31:21.000+0000 |
Updated | 2018-04-26T15:55:39.000+0000 |
Description
When calling Ti.Media.saveToPhotoGallery, the app crash on iOS 11.3 (the same code works on iOS 10.3).
//$.photo in an imageview
var savePhoto = $.photo.toImage();
Ti.Media.saveToPhotoGallery(savePhoto, {
success: function(e) {
Titanium.UI.createAlertDialog({
title:'Confirmation',
message:'Photo sauvegardé avec succès'
}).show();
},
error: function(e) {
Titanium.UI.createAlertDialog({
title:'Error saving',
message:e.error
}).show();
}
});
iOS 11.x requires
NSPhotoLibraryAddUsageDescription
when saving to the gallery, which is different toNSPhotoLibraryUsageDescription
that it for reading from the library. It is documented in the iOS 11 change log and should be added to the tiapp.xml.