We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
作者你好,我在项目中接入了jsbridge。目前有这样一个需求,在H5调用native的某一方法后,需要先通过网络请求拿到数据,然后将请求到的数据通过callback.apply()返回给H5页面。现在的情况是请求到数据之后callback.apply并没有触发H5页面的function回调,如果直接callback.apply()则可以正常回传数据。 js端代码:
bridge.call('native', 'getReadInfo', {}, function(result) { console.log(result) }
java端代码:
@Override public void getReadInfo(String type, String code, String jsonString, JBCallback callback){ //模拟网络请求 new Handler().postDelayed(() -> { callback.apply("s"); //此处调用无效 },3000); callback.apply("s");//调用有效 }
The text was updated successfully, but these errors were encountered:
应该是没问题的,可以参考下 ajax 方法的实现,推荐用 inspector 看看是否有 js 报错,还有就是打开日志开关,通过日志看看是否有报错
Sorry, something went wrong.
No branches or pull requests
作者你好,我在项目中接入了jsbridge。目前有这样一个需求,在H5调用native的某一方法后,需要先通过网络请求拿到数据,然后将请求到的数据通过callback.apply()返回给H5页面。现在的情况是请求到数据之后callback.apply并没有触发H5页面的function回调,如果直接callback.apply()则可以正常回传数据。
js端代码:
java端代码:
The text was updated successfully, but these errors were encountered: