quickjs-android
quickjs-android copied to clipboard
大佬 quickjs 有啥异步交互的api能用吗 promise await 都不支持?有其他能用的异步方案吗
可以这样
举例:
var requestParams = { "p1": "11" };
native.request("getHomeList", requestParams, function (e) {
native.log("response:" + JSON.stringify(e));
});
当参数为方法时,参数为JSFunction,然后持有这个引用call调用就好了
((JSFunction) args.get(2)).call(receiver, new JSArray(jsContext).push(111111));