packages
packages copied to clipboard
[webview_flutter] Adds onHttpError callback to NavigationDelegate to catch HTTP error status codes
This PR adds the onHttpError callback to NavigationDelegate to catch HTTP error status codes. In our app we need to catch the status codes to show native error pages/alerts or redirect users to the native login screen if the user is unauthenticated. The existing onWebResourceError is not sufficient.
The Android implementation uses the onReceiveHttpError callback from WebViewClient and the iOS implementation uses the decidePolicyForNavigationResponse delegate from WKWebView.
Fixes https://github.com/flutter/flutter/issues/39502.
Pre-launch Checklist
- [x] I read the Contributor Guide and followed the process outlined there for submitting PRs.
- [x] I read the Tree Hygiene wiki page, which explains my responsibilities.
- [x] I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/packages repo does use
dart format.) - [x] I signed the CLA.
- [x] The title of the PR starts with the name of the package surrounded by square brackets, e.g.
[shared_preferences] - [x] I listed at least one issue that this PR fixes in the description above.
- [x] I updated
pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes. - [x] I updated
CHANGELOG.mdto add a description of the change, following repository CHANGELOG style. - [x] I updated/added relevant documentation (doc comments with
///). - [x] I added new tests to check the change I am making, or this PR is test-exempt.
- [x] All existing and new tests are passing.
@HugoOlthof Are you planning on updating this based on the review feedback above?
@stuartmorgan Yes, I will update the PR as soon as possible!
This is the PR for webview_flutter_platform_interface: https://github.com/flutter/packages/pull/3645
The PR for the platform implementations: https://github.com/flutter/packages/pull/3695
Update from triage: this is waiting for the sub-PR to complete the review process.
Update from triage: sub-PR is still in progress.
Update from triage: Still waiting on https://github.com/flutter/packages/pull/3695
This is blocked on https://github.com/flutter/packages/pull/3695 which is blocked on https://github.com/flutter/packages/pull/4025 which is currently in review.
Update from triage: https://github.com/flutter/packages/pull/5790 has been created as a copy of the blocking PR, to try to start unwinding this stack.
Update from triage: the last PR in the stack is resolved, and this is now blocked on getting the next PR over the line.
Update from triage: implementation PR (referenced just above) is still in progress.
closing in favor of https://github.com/flutter/packages/pull/6378