Skip to content

解决native不能向h5页面传递非string类型数据的问题 #10

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ public void run() {
* @param responseCallback OnBridgeCallback
*/
public void callHandler(String handlerName, Object data, OnBridgeCallback responseCallback) {
if (!(data instanceof String)){
return;
}
// if (!(data instanceof String)){
// return;
// }
JSRequest request = new JSRequest();
if (data != null) {
request.data = (String) data;
request.data = data;
}
if (responseCallback != null) {
String callbackId = String.format(BridgeUtil.CALLBACK_ID_FORMAT, (++mUniqueId) + (BridgeUtil.UNDERLINE_STR + SystemClock.currentThreadTimeMillis()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class JSRequest {

public String callbackId;

public String data;
public Object data;

public String handlerName;
}