fluttercommunity / fluttercommunity/flutter_webview_plugin

Using WebviewScaffold to load URLs doesn't work in iOS

Đang mở
#969 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Java
Star
1.5k
Fork
936
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

## System info

Issue occurs on: iOS
Plugin version: 0.4.0
Flutter doctor output:

```
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.2, on macOS 14.1.2 23B92 darwin-arm64, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] Connected device (2 available)
[✓] Network resources

• No issues found!
```

## Steps to Reproduce

1. I am using the WebViewScaffold to launch a URL. This approach works fine on Android and the page is loaded. However, on iOS, it gives a white blank screen.
2. Followed all the steps mentioned in the documentation and the key "NSAppTransportSecurity" is added to the Info.plist file as recommended in the documentation.
3. The iOS app launches the URL and works fine if we use an instance of the FlutterWebViewPlugin to call the "launch()" method instead of the WebViewScaffold implementation.
4. There are no errors logged on the console while running it.
5. Here is the code that renders the view inside a StatefulWidget

```
...
return SafeArea(
child: WebviewScaffold(
url: _url,
mediaPlaybackRequiresUserGesture: false,
useWideViewPort: true,
appCacheEnabled: true,
geolocationEnabled: true,
invalidUrlRegex:
r'^(https:\/\/api\.whatsapp\.com|https:\/\/apps\.apple\.com|https:\/\/play\.google\.com|tel:|mailto:|https:\/\/www\.facebook\.com|https:\/\/www\.youtube\.com|https:\/\/www\.instagram\.com)',
debuggingEnabled: true,
),
);
```

## Logs

```
```

```
```

```
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Bắt đầu bằng cách tái hiện hành vi của iOS thông qua entry point WebviewScaffold, so sánh với FlutterWebViewPlugin.launch() và xem lại cấu hình Info.plist NSAppTransportSecurity được ghi chép. Issue không nêu tên tệp mã nguồn hay test nào, vì vậy trước tiên hãy xác định implementation WebView của iOS và thiết lập một URL cùng một trường hợp lỗi có thể tái hiện; được xem là hoàn tất khi URL được render thông qua WebviewScaffold trên iOS mà không làm hồi quy hành vi trên Android.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
flutter, ios
Lĩnh vực
mobile
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
30/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.