Skip to content

Conversation

j796160836
Copy link

Related issue: #376, enhanced Pull request by: #522.

Instead of implement native code, I advocate it handling that flutter side.
I extract both iOS and Android native callback into three functions.

Native callback

Android iOS
Alert public boolean onJsAlert(WebView view, String url, String message, final JsResult result) webView(_:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:)
Confirm public boolean onJsConfirm(WebView view, String url, String message, final JsResult result) webView(_:runJavaScriptConfirmPanelWithMessage:initiatedByFrame:completionHandler:)
Prompt public boolean onJsPrompt(WebView view, String url, String message, String defaultValue, final JsPromptResult result) webView(_:runJavaScriptTextInputPanelWithPrompt:defaultText:initiatedByFrame:completionHandler:)

Flutter callback

Flutter
Alert flutterWebViewPlugin.onJSAlert = (alert) async { };
Confirm flutterWebViewPlugin.onJSConfirm = (confirm) async { };
Prompt flutterWebViewPlugin.onJSPrompt = (prompt) async { };

Also, I filled up the example.

lejard-h and others added 30 commits May 18, 2018 17:35
Never set minSdk and targetSdk in manifest.
Taking safe areas into account for bottom bars
Add 'show', 'hide', and 'reloadUrl' functions
masewo and others added 11 commits November 14, 2019 15:06
…#600)

* added callbacks to canGoForward and canGoBack for android

* added flutter tests
added ios implementation

* updated readme
* Fixed ios compilation, added clear cache for ios

* added cleaning cache for android

* updated readme
* add ignoreSSLErrors parameter - just Android

* iOS implementation to allow ignore SSL Errors

* add documentation for ignoreSSLErrorsFlag

* remove log messages used for ignorSSLErrors debug
* remove local properties

* added jetifier for example project
Fixed some typos. Good writeup.
@j796160836 j796160836 force-pushed the develop/alert_interface branch from 6780259 to 3973221 Compare January 30, 2020 14:28
@j796160836 j796160836 requested review from charafau, lejard-h and slightfoot and removed request for charafau and lejard-h February 3, 2020 07:04
@charafau
Copy link
Collaborator

charafau commented Apr 7, 2020

Thank you for PR and sorry for long review time, I am quite busy these days.
I will review this asap, although code doesn't work for me for example project.

@shinriyo
Copy link

@j796160836 conflicted

Johnny added 5 commits January 17, 2022 09:36
# Conflicts:
#	.github/workflows/android_ut.yml
#	.github/workflows/flutter_ut.yml
#	CHANGELOG.md
#	README.md
#	example/lib/main.dart
#	ios/Classes/FlutterWebviewPlugin.m
#	lib/src/base.dart
#	lib/src/javascript_channel.dart
#	lib/src/webview_scaffold.dart
#	pubspec.yaml
#	test/flutter_webview_plugin_test.dart
@j796160836 j796160836 force-pushed the develop/alert_interface branch from 06f8d9f to fc996e2 Compare January 17, 2022 01:59
@jfacoustic
Copy link

Any updates on this feature?

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.