fluttercommunity / fluttercommunity/flutter_webview_plugin
onHttpError called with a 200 code
- 主要言語
- Java
- スター
- 1.5k
- フォーク
- 938
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
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.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
FlutterWebviewPlugin.m、特にレポートでブレークポイントに到達するとされている WKWebView decidePolicyForNavigationResponse から開始してください。onHttpError がトリガーされる前にナビゲーションレスポンスがどのように分類されるかを追跡し、HTTP 200 のレスポンスがエラーとして扱われないことを確認してください。その後も既存の WebView の動作が引き続き機能する必要があります。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- dart, ios, objective-c
- 領域
- mobile-dev
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100