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

Add support for sending data from webview to native in iOS and Android #457

Closed
wants to merge 3 commits into from

Conversation

OPY-bbt
Copy link

@OPY-bbt OPY-bbt commented Jun 26, 2019

  • create the local http-server in example/html folder (for example: by http-server)
  • modify the messageUrl in main.dart to your http-server url
  • run the example project and click the Open Webview (message demo)button
  • click send to flutter button in webview and you can see the result in the bottom.

public void postMessage(String value){
Map<String, String> postMessageMap = new HashMap<>();
postMessageMap.put("postMessage", value);
FlutterWebviewPlugin.channel.invokeMethod("onPostMessage", postMessageMap);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a error:
java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: JavaBridge
maybe use 'new Handler(Looper.getMainLooper())'

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did you solve this error
?
I have a error:
java.lang.RuntimeException: Methods marked with @UiThread must be executed on the main thread. Current thread: JavaBridge
maybe use 'new Handler(Looper.getMainLooper())'
I am getting the same

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I add mainLooper in commit, are you sure on the lastest branch?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#523 is already implemented on the main branch

@ashbin
Copy link

ashbin commented Jul 18, 2019

#71

@diegovar
Copy link

Can this be merged in?

@kevinpthorne
Copy link

Please? x)

@rinlv
Copy link
Contributor

rinlv commented Aug 16, 2019

still waiting 🔢

@rinlv
Copy link
Contributor

rinlv commented Aug 19, 2019

I solved this problem with dynamic channel name for Android and iOS #523. Hope it's helpful

@ragaisis
Copy link

This one is is important for us too

@phamquan
Copy link

phamquan commented Oct 8, 2019

Please resolve and merge this request

1 similar comment
@hungbu
Copy link

hungbu commented Oct 16, 2019

Please resolve and merge this request

@OPY-bbt
Copy link
Author

OPY-bbt commented Oct 17, 2019

This is already implemented on the main branch, see example.

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

Successfully merging this pull request may close these issues.

10 participants