将iOS原生代码对Cordova插件的简单封装
function begin(){
cordova.exec(alertSuccess,alertFail,"PhotoSnipPlugin","coolMethod",["camera","1"]);
}
调用成功的回调函数
function alertSuccess(msg) {
alert(msg);
}
调用失败的回调函数
function alertFail(msg) {
alert('调用OC失败: ' + msg);
}
将插件
文件下PhotoSnipPlugin
导入到工程即可使用
感谢作者3tinkers/TKImageView,本人只是代码的搬运工...