fluttercommunity / fluttercommunity/flutter_webview_plugin
onHttpError called with a 200 code
- Langage dominant
- Java
- Étoiles
- 1.5k
- Forks
- 938
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Description
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.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Piste de recherche
Commencez dans FlutterWebviewPlugin.m, en particulier dans WKWebView decidePolicyForNavigationResponse, où le rapport indique que le point d’arrêt est atteint. Suivez la manière dont la réponse de navigation est classifiée avant le déclenchement de onHttpError, et vérifiez qu’une réponse avec HTTP 200 n’est pas traitée comme une erreur ; le comportement existant de WebView devrait continuer à fonctionner ensuite.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- dart, ios, objective-c
- Domaine
- mobile-dev
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 35/100