Skip to content
This repository has been archived by the owner on Apr 22, 2018. It is now read-only.

Latest commit

 

History

History
36 lines (27 loc) · 1.15 KB

README.md

File metadata and controls

36 lines (27 loc) · 1.15 KB

Cordova Save Image From URL -Plugin

A very simple plugin for Cordova 3.x.x to save an image from a URL.

by Ronald Klip (github.com/RonaldPK)

Supported Platforms

  • iOS

Adding the Plugin to your project

Through the Command-line Interface:

cordova plugin add https://github.com/RonaldPK/SaveImageFromURL.git

Release Notes

Version 1.0.0 (22-08-2013)

  • Initial release.

Using the plugin

The plugin creates the object window.plugins.saveImage with one method:

saveImageFromURL()

Takes two parameters: url and a string with the name of the callback method

window.plugins.saveImage.saveImageFromURL(url, cbRef);

The plugin returns 1 on success and 0 on failure. Failure is most likely due to the app not having access to the user's Photos.

Example

var myCallbackMethod = function(returnVal) {console.log(returnVal);}
window.plugins.saveImage.saveImageFromURL('http://www.example.com/path/to/image.png', 'myCallbackMethod');