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

@rinlv rinlv commented Aug 19, 2019

See an example here

@samuelsarix
Copy link

Thank You, needed this

@charafau
Copy link
Collaborator

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

@rinlv
Copy link
Contributor Author

rinlv 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
Copy link
Contributor

ivanasen 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
Copy link
Collaborator

I will make review and check code on Monday 👍

Copy link
Collaborator

@charafau charafau left a comment

Choose a reason for hiding this comment

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

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/ios/Runner.xcodeproj/project.pbxproj Show resolved Hide resolved
example/lib/main.dart Outdated Show resolved Hide resolved
android/src/main/AndroidManifest.xml Show resolved Hide resolved
@rinlv
Copy link
Contributor Author

rinlv commented Sep 16, 2019

@charafau Please check then merge this pull

@charafau
Copy link
Collaborator

@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
Copy link

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

@rjsajnani
Copy link

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

@mzF414
Copy link

mzF414 commented Dec 20, 2019

How to use the 'JavascriptChannel' ?

charafau pushed a commit that referenced this pull request Apr 7, 2020
charafau added a commit that referenced this pull request Apr 7, 2020
Listen javascript function from flutter
arok pushed a commit to arok/flutter_webview_plugin that referenced this pull request Mar 21, 2022
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.

7 participants