CDVPluginResult*pluginResult = [CDVPluginResultresultWithStatus:CDVCommandStatus_OKmessageAsString:@""];
[self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
这个就是OC回调JS方法
//这边就是JS发起调用OC函数
cordova.exec(this.testSuccess,this.testFail,"TestPluginName","testPluginFunctionWithArgumentsAndCallBack", [{"name":"小明"}, {"age":"9"}, {"frends": ["小白","小溪"]}]);
网友评论