Fork from https://github.com/mrPalm/saveToPhotolibrary
cordova plugin add cordova-ios-photo-library
You do not need to reference any JavaScript, the Cordova plugin architecture will add a socialmessage object to your root automatically when you build.
Ensure you use the plugin after your deviceready event has been fired.
window.ImageHelper.saveToUserLibrary(imageUrl, successCallback, failCallback);