Skip to content

Add optional navigation delegate to ios PlatformWebViewParams#407

Open
cyborch wants to merge 2 commits into
KevinnZou:mainfrom
cyborch:feature/ios-navigation-delegate-param-support
Open

Add optional navigation delegate to ios PlatformWebViewParams#407
cyborch wants to merge 2 commits into
KevinnZou:mainfrom
cyborch:feature/ios-navigation-delegate-param-support

Conversation

@cyborch

@cyborch cyborch commented Jun 26, 2026

Copy link
Copy Markdown

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.

@cyborch
cyborch force-pushed the feature/ios-navigation-delegate-param-support branch from 799a730 to 64a272c Compare June 26, 2026 07:17
@cyborch
cyborch marked this pull request as ready for review June 26, 2026 07:18
Copilot AI review requested due to automatic review settings June 26, 2026 07:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 through ActualWebView into the iOS WebView implementation.
  • iOS: forward several WKNavigationDelegateProtocol callbacks (start, redirect, commit, finish, failures, process termination, decidePolicy) to the optional user delegate when implemented.
  • Android: raises android.minSdk from 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.

Comment thread gradle.properties
@cyborch
cyborch force-pushed the feature/ios-navigation-delegate-param-support branch from 17976de to 14fea96 Compare June 27, 2026 09:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants