Skip to content
New issue

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

bridge方法如果传值string,android端拿到两头会自带双引号 #18

Closed
puzhengwu opened this issue Jul 23, 2021 · 3 comments
Closed

Comments

@puzhengwu
Copy link

看是否需要调整一下,还是我需要自己去把引号去掉,或者用JSON方式反序列化成String

@smallbuer
Copy link
Owner

看是否需要调整一下,还是我需要自己去把引号去掉,或者用JSON方式反序列化成String

由于注入的js代码中有将H5传入的数据进行JSON.stringify(message)处理,可以参考jscript目录下WebViewJavascriptBridge.js中81行,此处对H5传入的数据进行了字符串转换,所以建议H5传入的时候直接以json对象的形式传递即可

@icetea0822
Copy link

要是前段传的本身就是JSON.stringify咋办,搞死我了,原封不动传过来才对啊

@smallbuer
Copy link
Owner

可以更新到1.0.7版本,已经对H5传入类型进行判断,避免两层引号问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants