Book Image

PhoneGap By Example

Book Image

PhoneGap By Example

Overview of this book

Table of Contents (17 chapters)
PhoneGap By Example
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Building a custom plugin to save the picture in the iOS library


We successfully saved the picture into the application's Imaginary folder, but we would like to save the picture with the applied effect to the device's library. In this example, it will be the iOS library.

There is no direct access to the iOS library from the HTML5 FileSystem API. There is no such official plugin. In this case, what we need to do is develop a custom plugin for PhoneGap/Cordova.

I will reference the Cordova plugin development guide and follow all these steps:

A Cordova plugin is a package with native and JavaScript code that allows WebView to communicate with the native platform on which it runs.

The plugin setup

Let's create...