Added save to gallery option - IOS only

This commit is contained in:
victorsosa
2016-05-06 16:23:55 -04:00
parent 93004b06f4
commit 63b581492d

View File

@ -15,6 +15,7 @@ class UIImagePickerControllerDelegateImpl extends NSObject implements UIImagePic
private _width: number; private _width: number;
private _height: number; private _height: number;
private _keepAspectRatio: boolean; private _keepAspectRatio: boolean;
private _saveToGallery: boolean;
public initWithCallback(callback: (result?) => void): UIImagePickerControllerDelegateImpl { public initWithCallback(callback: (result?) => void): UIImagePickerControllerDelegateImpl {
this._callback = callback; this._callback = callback;
@ -60,10 +61,12 @@ class UIImagePickerControllerDelegateImpl extends NSObject implements UIImagePic
if (this._callback) { if (this._callback) {
this._callback(imageSourceResult); this._callback(imageSourceResult);
if(this._saveToGallery) {
UIImageWriteToSavedPhotosAlbum(imageSourceResult, nil, nil, nil); UIImageWriteToSavedPhotosAlbum(imageSourceResult, nil, nil, nil);
} }
} }
} }
}
picker.presentingViewController.dismissViewControllerAnimatedCompletion(true, null); picker.presentingViewController.dismissViewControllerAnimatedCompletion(true, null);
listener = null; listener = null;
} }