Cordova JS OC交互方法

作者: XLsn0w | 来源:发表于2017-04-19 10:34 被阅读47次

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": ["小白","小溪"]}]);

相关文章

网友评论

    本文标题:Cordova JS OC交互方法

    本文链接:https://www.haomeiwen.com/subject/iepczttx.html