fluttercommunity / fluttercommunity/flutter_webview_plugin

onHttpError called with a 200 code

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

Mô tả

I'm using this plugin for a payment process (using a bank web interface).
I first load a generated HTML page (given a `Uri.dataFromString()` with `mimeType` sets to `text/html`) that build a form that auto-submit with action field sets to the bank server URL (where you enter your credit card information).

This workflow works fine on Android but I'm having a strange behavior on iOS. Right after the state changed to `WebViewState.startLoad` (with the bank server URL), `onHttpError` is triggered with a HTTP 200 code.

I initially quit the webview when an error occur to show a message. So I add a test to avoid false error codes and the web page works fine despite the error.

My app use the latest version (0.3.5).

I would like to know what can cause this behavior, I tried to put breakpoints in Xcode to have more info directly from the `WKWebView didFailNavigation` (inside FlutterWebviewPlugin.m) but my breakpoint is never hit...

**EDIT:** Putting the breakpoint in `WKWebView decidePolicyForNavigationResponse` works.
Reading the code inside this method I noticed that there is no test to determined if the response is effectively an error.

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 trong FlutterWebviewPlugin.m, đặc biệt là tại WKWebView decidePolicyForNavigationResponse, nơi báo cáo cho biết breakpoint được chạm tới. Theo dõi cách phản hồi điều hướng được phân loại trước khi onHttpError được kích hoạt, và xác minh rằng phản hồi có HTTP 200 không bị coi là lỗi; hành vi hiện có của WebView vẫn phải tiếp tục hoạt động sau đó.

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

Đánh giá

Công nghệ
dart, ios, objective-c
Lĩnh vực
mobile-dev
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/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.