//调用js方法 然后执行回调
.onPageEnd(async () => {
let token = await PreferencesUtil.get(SpConstants.AccessToken,'') as string
this.controller.runJavaScriptExt('NativeUpLoadToken('+token+')').then((result) =>{
ToastUtil.showToast("返回的result"+JSON.stringify(result));
})
})
方法执行了,但是前端并没有接收到数据,请问如何去解决呢?
通过官方案例是可以正常拿到值的,请参考官方文档:https://developer.huawei.com/consumer/cn/doc/harmonyos-references-V5/js-apis-webview-V5\#runjavascriptext10-1