Cordova JS OC互動方法

bluepeach發表於2021-09-09

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



作者:XLsn0w
連結:


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/2558/viewspace-2812324/,如需轉載,請註明出處,否則將追究法律責任。

相關文章