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

Blank screen on iOS: flutter_webview_plugin: ^0.3.0+2 #239

Closed
willvlad opened this issue Nov 15, 2018 · 26 comments
Closed

Blank screen on iOS: flutter_webview_plugin: ^0.3.0+2 #239

willvlad opened this issue Nov 15, 2018 · 26 comments

Comments

@willvlad
Copy link

image
screenshot 2018-11-15 21 04 25

@charafau
Copy link
Collaborator

hi @willvlad thanks for reporting an issue. This works for me on 11.3 could you update the simulator and check if that the reason? Also please provide flutter doctor output

screen shot 2018-11-16 at 12 36 48

@willvlad
Copy link
Author

Have re-downloaded the simulator again yesterday. 11.2 is the top version for my xcode . Hasn't helped unfortunately. Here is the doctor:

[✓] Flutter (Channel unknown, v0.11.3, on Mac OS X 10.12.6 16G1618, locale en-GB)
    • Flutter version 0.11.3 at /Users/vv/Desktop/development/flutter
    • Framework revision 72bf075e8d (6 days ago), 2018-11-09 20:36:17 -0800
    • Engine revision 5646e86a6f
    • Dart version 2.1.0 (build 2.1.0-dev.9.3 9c07fb64c4)

[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
    • Android SDK at /Users/vv/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-27, build-tools 27.0.3
    • Java binary at: /Library/Java/JavaVirtualMachines/jdk1.8.0_162.jdk/Contents/Home/bin/java
    • Java version Java(TM) SE Runtime Environment (build 1.8.0_162-b12)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 9.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 9.2, Build version 9C40b
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 30.0.1
    • Dart plugin version 181.5656
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)

[✓] IntelliJ IDEA Community Edition (version 2018.2.5)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 30.0.2
    • Dart plugin version 182.5124

[✓] VS Code (version 1.28.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.20.0

[✓] Connected device (1 available)
    • iPhone X • 210F9FC0-1647-4E87-A470-5C446C5A01BA • ios • iOS 11.2 (simulator)

• No issues found!

@hatzyuta
Copy link

Check the url you tried to open with this plugin.
I had the same problem, but I have opened a web page correctly after changed the scheme of the url from 'http' to 'https'.

@candicerimba
Copy link

I've got the same issue. The links are in https://, and it works on Android, but only selected links in iOS works.

@ghost
Copy link

ghost commented Nov 23, 2018

Same here. Running iOS 12.1 on iPhone 7 is blank screen (except on short, simple url) where Androids work fine. I'm guessing it's either something with a query parameter on the url or javascript on the page.

EDIT: I have a native iOS app with a webview. The company I work for requires their proprietary login which is in a webpage at a url with query parameters appended. I am certain that is the problem here as if I try loading any other url without query parameters using your library, it works fine. Let me know if you want the fix, it's 10 lines of code ;)

@charafau
Copy link
Collaborator

hi @nhojjava you're more than welcomed to submit your PR! I've seen this issue few times but didn't reproduce it myself. If you have fix that would be great!

@shibbs1
Copy link

shibbs1 commented Nov 28, 2018

@nhojjava please add the fix. I am trying to open this link on iOS and it shows blank screen: http://www.erzabtei-beuron.de/schott/schott_anz.php?file=jk34/Mittwoch.htm

@jlzhou
Copy link

jlzhou commented Nov 28, 2018

same blank screen

@pneves001
Copy link

I'm having a similar issue with this in IOS. I managed to get it working as a fullscreen widget where I'm using the scaffolding features to decorate the screen. However, if I embed the view into another page as a sub widget the screen is blank on IOS. The plugin works perfectly in Android and is able to embed the Webview into a subscreen. Just not IOS.

@JunevaYang
Copy link

me too

@shibbs1
Copy link

shibbs1 commented Dec 3, 2018

On further inspection, I found that the server was updating http://... url link to https://.... So I changed the http:// link to https:// on the client (flutter app) itself... now I don't see anymore blank screen.
On the flutter app
Link: http://www.erzabtei-beuron.de/schott/schott_anz.php?file=jk34/Mittwoch.htm
Changed to: https://www.erzabtei-beuron.de/schott/schott_anz.php?file=jk34/Mittwoch.htm
(as the server was anyways changing it to https url....)

No more blank screen on iOS.

@nhojjava please add the fix. I am trying to open this link on iOS and it shows blank screen: http://www.erzabtei-beuron.de/schott/schott_anz.php?file=jk34/Mittwoch.htm

@NewITCorp
Copy link

NewITCorp commented Dec 7, 2018

I also had this. So it is reported for quite a month?

@willvlad
Copy link
Author

The issue persists even after upgrading to iOS 12.1 and using https://
Still blank screen on iOS, though works on Android

@BANG88
Copy link

BANG88 commented Dec 19, 2018

Try to add an userAgent which works for me.

const userAgent =
    'Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Mobile Safari/537.36';

@lucasjinreal
Copy link

@BANG88 How to add?

@quangas
Copy link

quangas commented Feb 21, 2019

what about updating Info.plist ? This worked for me

<key>NSAppTransportSecurity</key>
<dict>
	<key>NSAllowsArbitraryLoads</key>
	<true/>
</dict>

@ambofx
Copy link

ambofx commented Feb 22, 2019

@quangas Suggested work around is working for me.
Thanks bro!

@mintotsai
Copy link

@quangas Work around works for me. Thanks.

@slyfalcon
Copy link

@quangas it works!
In the /ios/Runner/Info.plist
add
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
if you are running in the emulator, please quit and rebuild, then it works.
It will keep blank if you just press 'R' or 'r'

@harsha973
Copy link

harsha973 commented Mar 30, 2019

@quangas Doesn't work for me :( I'm using iOS 12.2.

Downloaded this repo and ran the example. Click on

  • Executed in Android - Worked. Can see Flutter web page 💯
  • Executed in iOS - Failed 👎

Flutter doctor

    • Flutter version 1.2.1 at /Users/sree/Work/Installation/flutter
    • Framework revision 8661d8aecd (6 weeks ago), 2019-02-14 19:19:53 -0800
    • Engine revision 3757390fa4
    • Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/sree/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/sree/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.2)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.2, Build version 10E125
    • ios-deploy 1.9.4
    • CocoaPods version 1.6.1

[✓] Android Studio (version 3.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 33.4.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] Connected device (2 available)
    • Android SDK built for x86 • emulator-5554                        • android-x86 • Android 8.1.0 (API 27)
      (emulator)
    • iPhone Xʀ                 • 23CF6EE1-635A-472A-BAA9-C9165778A151 • ios         •
      com.apple.CoreSimulator.SimRuntime.iOS-12-2 (simulator)

Simulator Screen Shot - iPhone Xʀ - 2019-03-31 at 10 45 04

🎉 🎉 UPDATE - FIXED 🎉 🎉

It's nothing to do with flutter_webview_plugin.
I have an antivirus running in my MAC and it blocked the request. Disabled Antivirus from monitoring network calls and all sorted. 💯

@charafau
Copy link
Collaborator

charafau commented Apr 2, 2019

I think we should update docs then, will close after updating.

@charafau
Copy link
Collaborator

charafau commented May 3, 2019

related: #239

@charafau charafau closed this as completed May 3, 2019
@jaweii
Copy link

jaweii commented Jul 9, 2019

I have the same problem.
^0.3.5
iPhone X;

@willvlad
Copy link
Author

willvlad commented Jul 9, 2019

Make sure your iPhone settings allows for HTTP services - you can find them under Settings - Developer. Hope this helps.

@charafau
Copy link
Collaborator

It works on develop. For release you need to add NSAppTransportSecurity into your plist

@ervinod
Copy link

ervinod commented Feb 26, 2021

Same here. Running iOS 12.1 on iPhone 7 is blank screen (except on short, simple url) where Androids work fine. I'm guessing it's either something with a query parameter on the url or javascript on the page.

EDIT: I have a native iOS app with a webview. The company I work for requires their proprietary login which is in a webpage at a url with query parameters appended. I am certain that is the problem here as if I try loading any other url without query parameters using your library, it works fine. Let me know if you want the fix, it's 10 lines of code ;)

How to resolve this issue?

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