feat: Add iOS Screen Time detection to webview_flutter_wkwebview #6
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for detecting when a Flutter webview is blocked by iOS Screen Time restrictions, implementing the feature requested in Linear ticket PRO-2378.
Changes Made
getIsBlockedByScreenTime()method toUIViewWKWebViewclass inpigeons/web_kit.dartWebViewProxyAPIDelegate.swiftwith iOS 26.0+ availability checkisBlockedByScreenTimegetter toWebKitWebViewControllerclass with proper error handlingImplementation Details
The implementation exposes the iOS 26.0+
WKWebView.isBlockedByScreenTimeproperty through a new getter onWebKitWebViewController. The property returnsfalseon iOS versions prior to 26.0, providing graceful fallback behavior.Usage Example
Acceptance Criteria
Files Modified
pigeons/web_kit.dart- Pigeon API definitionlib/src/common/web_kit.g.dart- Auto-generated Dart codedarwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebKitLibrary.g.swift- Auto-generated Swift codedarwin/webview_flutter_wkwebview/Sources/webview_flutter_wkwebview/WebViewProxyAPIDelegate.swift- Swift implementationlib/src/webkit_webview_controller.dart- Dart public APICHANGELOG.md- Feature documentationREADME.md- Usage exampleTesting
This feature can be manually tested on iOS 26+ devices/simulators with Screen Time restrictions configured. For older iOS versions, the property should return
falsewithout errors.🤖 Generated with Claude Code