Flutter webview plugin

98 views
Skip to first unread message

Badmus Adeyinka

unread,
Apr 20, 2020, 12:10:57 PM4/20/20
to Flutter Development (flutter-dev)

I have an issue with webview flutter. I am trying to make payments with some payment platforms in flutter webview. The payment platforms do OTP verfication using another tab but the webview plugins get stuck at that point.
//flutter_webview_plugin
WebviewScaffold(
   url: "${widget.transactionUrl}",
   withZoom: true,
   withLocalStorage: true,
   hidden: true,
   withJavascript: true,
   scrollBar: true,
   supportMultipleWindows: true,
   ignoreSSLErrors: true,
   withOverviewMode: true,
   appCacheEnabled: true,
   debuggingEnabled: true
) 

The above is implemented with flutter_webview_plugin v0.3.11. With supportMultipleWindows set to true, it never displays that new tab, therefore OTP verification cannot be done, when set to false, it does display that OTP verification page on the same page but after entering the OTP and submitting, it cannot return to the previous page to complete the transaction and just outputs the json response for the OTP to the view instead. This is the exact issue with the official webview plugin webview_flutter v0.3.20 although this will always opens the tab on the same page.

//webview_flutter
WebView(
  gestureNavigationEnabled: true,
  onPageStarted: (String url) {},
  onPageFinished: _handleLoad,
  javascriptMode: JavascriptMode.unrestricted,
  initialUrl: "${widget.transactionUrl}",
  onWebViewCreated: (WebViewController webViewController) {
     _controller.complete(webViewController);
  },
)

Most of the source code has been kept out to ensure this is as short as possible. Thank you very much in advance. I'd really appreciate a way out of this.

Reply all
Reply to author
Forward
0 new messages