Add optional navigation delegate to ios PlatformWebViewParams#407
Open
cyborch wants to merge 2 commits into
Open
Add optional navigation delegate to ios PlatformWebViewParams#407cyborch wants to merge 2 commits into
cyborch wants to merge 2 commits into
Conversation
cyborch
force-pushed
the
feature/ios-navigation-delegate-param-support
branch
from
June 26, 2026 07:17
799a730 to
64a272c
Compare
cyborch
marked this pull request as ready for review
June 26, 2026 07:18
There was a problem hiding this comment.
Pull request overview
Adds support for providing a custom iOS WKNavigationDelegate-compatible delegate via PlatformWebViewParams, and forwards selected navigation callbacks from the library’s internal delegate to the user-provided one.
Changes:
- iOS: introduce
PlatformWebViewParams(delegate: WKNavigationDelegateProtocol?)and plumb it throughActualWebViewinto the iOS WebView implementation. - iOS: forward several
WKNavigationDelegateProtocolcallbacks (start, redirect, commit, finish, failures, process termination, decidePolicy) to the optional user delegate when implemented. - Android: raises
android.minSdkfrom 21 to 24 (appears unrelated to the PR’s stated purpose).
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| webview/src/iosMain/kotlin/com/multiplatform/webview/web/WKWebViewObserver.kt | Adds an explicit final modifier (no functional change). |
| webview/src/iosMain/kotlin/com/multiplatform/webview/web/WKNavigationDelegate.kt | Forwards navigation delegate callbacks to an optional user-provided delegate from PlatformWebViewParams. |
| webview/src/iosMain/kotlin/com/multiplatform/webview/web/WebView.ios.kt | Adds iOS PlatformWebViewParams(delegate) and passes it into the internal navigation delegate. |
| webview/src/iosMain/kotlin/com/multiplatform/webview/jsbridge/WKJsMessageHandler.kt | Adds an explicit final modifier (no functional change). |
| webview/src/commonMain/kotlin/com/multiplatform/webview/web/WebView.kt | Updates KDoc to reflect iOS params usage (needs a type-name correction). |
| gradle.properties | Raises Android minSdk to 24 (breaking change; likely out of scope for this PR). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
cyborch
force-pushed
the
feature/ios-navigation-delegate-param-support
branch
from
June 27, 2026 09:10
17976de to
14fea96
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds the ability to set a navigation delegate on iOS
The in delegate must implement WKNavigationDelegateProtocol and is added to the iOS version of PlatformWebViewParams.