Cordova - how to save an image to iOS photo gallery?

774 Views Asked by At

We are using the Cordova file plugin to save images to device image gallery. Works fine on Android but can't save an image to the iOS photo gallery using this tutorial. We have used the following paths but no luck so far.

folderpath = window.cordova.file.applicationStorageDirectory + "Library/";
folderpath = window.cordova.file.documentsDirectory;
folderpath = window.cordova.file.syncedDataDirectory;
folderpath = window.cordova.file.dataDirectory;

please advice. Thanks

1

There are 1 best solutions below

0
On

https://www.npmjs.com/package/cordova-plugin-save-image

You should use this plugin

window.cordova.plugins.imagesaver.saveImageToGallery(nativePathToJpegImage, function(success){}, function(error){});

nativePathToJpegImage is folderpath.