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

WebView always hidden on iOS #385

Closed
malloy045 opened this issue Apr 12, 2019 · 6 comments
Closed

WebView always hidden on iOS #385

malloy045 opened this issue Apr 12, 2019 · 6 comments

Comments

@malloy045
Copy link

malloy045 commented Apr 12, 2019

Issue

The webview seems to launch, but it's not visible on iOS (physical device or simulator).
Plugin Version: flutter_webview_plugin: ^0.3.3

It works fine on Android (physical device, emulator on PC and emulator on Mac). I don't see the webview appear or try to appear at all when using an iOS device (physical or simulator). All I see is the underlying Flutter UI.

However, based on the console output and breakpoints being hit, one can deduce that the webview IS launching, but it's just hidden.

What I tried

  • explicitly launching the url with hidden: false
  • explicitly called .show() before and after .launch(...)
  • tried a benign URL https://google.com
  • tried a non-https URL
  • removed all other flutter UI elements on the the page
  • downgraded plugin versions until I hit 0.2.1 - it broke when I went lower than 0.3.0
  • added plist entries to disable basically all transport layer security
    <key>NSAppTransportSecurity</key>
    <dict>
       <key>NSAllowsArbitraryLoads</key>
       <true/>
       <key>NSAllowsArbitraryLoadsInWebContent</key>
       <true/>
    </dict>
    

Steps to reproduce

Code Output

Xcode build done.                                           12.1s
flutter: Webview launch
flutter: State changed: URL = https://google.com/
flutter: URL changed: URL = https://google.com/
flutter: State changed: URL = https://google.com/
flutter: State changed: URL = https://www.google.com/
flutter: URL changed: URL = https://www.google.com/
flutter: HTTP error: Code = 200
flutter: State changed: URL = https://www.google.com/

Flutter doctor output

> flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.2.1, on Mac OS X 10.14 18A391, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.3)
[✓] VS Code (version 1.33.0)
[✓] Connected device (1 available)
@azkdev
Copy link

azkdev commented Apr 17, 2019

hi there =)
any workaround here ?

this is happen too when we pushing new Route, after Navigator.pop(context), the webview is working, but it's hidden.
webviewplgin.show() method does not help.

@malloy045
Copy link
Author

malloy045 commented Apr 17, 2019

hi there =)
any workaround here ?

Not that I know of, but I'm slightly relieved I'm not the only one experiencing this. Although, I've moved on to trying other libraries.

this is happen too when we pushing new Route, after Navigator.pop(context), the webview is working, but it's hidden.
webviewplgin.show() method does not help.

Our scenario is slightly different. I stripped everything out my app and all I have is a single view that tries to launch this immediately on build. No dice.

@azkdev
Copy link

azkdev commented Apr 17, 2019

with any other webview, this will be ok.
but for now, flutter_webview_plugin only can handle input forms from web, or select inputs.
another webview by google flutter_webview crashes the application when trying to focus input fields or select tags. =(

@malloy045
Copy link
Author

malloy045 commented Apr 17, 2019

I fixed this issue in this PR: #393

@charafau
Copy link
Collaborator

Thanks @malloy045 for the fix, merged and published in 0.3.4

@malloy045
Copy link
Author

Thanks @malloy045 for the fix, merged and published in 0.3.4

Anytime! Thanks for the quick turnaround.

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

No branches or pull requests

3 participants