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

Listen javascript function from flutter #523

Merged
merged 8 commits into from Sep 23, 2019

Conversation

@rinlv
Copy link
Contributor

commented Aug 19, 2019

See an example here

@samuelsarix

This comment has been minimized.

Copy link

commented Aug 19, 2019

Thank You, needed this

@charafau

This comment has been minimized.

Copy link
Collaborator

commented Aug 22, 2019

Thanks for PR, give me some time to review this. Just looking at title of this - #457 what's difference between the two ?

@rinlv

This comment has been minimized.

Copy link
Contributor Author

commented Aug 22, 2019

@charafau This #457 use fixed channel 'Android' to listen to JS function for Android version, my solutions help using the dynamic channel for both Android and iOS. More, I'm following this webview_flutter to make this PR. It's mean just call
Channel.postMessage(data) to listen to JS function for both Android and iOS, not complicated like this example of #457

@ivanasen

This comment has been minimized.

Copy link
Contributor

commented Aug 22, 2019

@rinlv I've made a few changes to the dart part, namely adding the whole Javascript channel abstraction, which removes the need to do a switch on the channel for example when a message is received. I've made a pull request on your repo here

Add JavascriptChannel abstraction in dart code
@charafau

This comment has been minimized.

Copy link
Collaborator

commented Aug 25, 2019

I will make review and check code on Monday 👍

Copy link
Collaborator

left a comment

Thanks for PR! I made some comments, but didnt compile that code yet. Code looks good though, will check tomorrow if it works as expected.

example/lib/main.dart Outdated Show resolved Hide resolved
android/src/main/AndroidManifest.xml Show resolved Hide resolved
@rinlv

This comment has been minimized.

Copy link
Contributor Author

commented Sep 16, 2019

@charafau Please check then merge this pull

@charafau

This comment has been minimized.

Copy link
Collaborator

commented Sep 20, 2019

@rinlv thanks for commits! I will do that after weekend, got urgent plans

@charafau charafau merged commit f1f077f into fluttercommunity:master Sep 23, 2019
@alereisan

This comment has been minimized.

Copy link

commented Oct 4, 2019

@charafau is this already available? I am getting Error: No named parameter with the name 'javascriptChannels' on version 0.3.8

@rjsajnani

This comment has been minimized.

Copy link

commented Oct 16, 2019

Even i faced this same issue so i added this to my code base and it worked fine

dependencies: flutter_webview_plugin: git: url: https://github.com/fluttercommunity/flutter_webview_plugin.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.