Skip to content

Allow Swift hosts to handle navigation links - #852

Merged
kiftio merged 4 commits into
mainfrom
swift-intercept-navigation-deep-links
Oct 1, 2026
Merged

kiftio merged 4 commits into
mainfrom
swift-intercept-navigation-deep-links

Conversation

@kiftio

@kiftio kiftio commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Stacked on #851.

Swift had the same split behavior as Android: protocol ec.window.open_request calls consulted onLinkClick, but a raw WKNavigationDelegate navigation to a deep link opened through UIApplication directly.

Apply the existing linkActionProvider to intercepted deep-link navigation before the default external URL handler:

  • open preserves the current default behavior.
  • handled lets the host own routing.
  • cancel blocks the navigation.

This keeps Swift and Android consistent and makes onLinkClick govern both protocol window-open requests and native WebView deep-link navigation.

Tests

  • Added coverage that handled and cancel prevent the external URL handler from being invoked for a navigation deep link.
  • Ran:
    platforms/swift/Scripts/xcode_run test ShopifyCheckoutKit-Package CheckoutWebViewTests
    93 tests passed.

Diagnostics

Adds debug logging that distinguishes an intercepted raw navigation link from the host or SDK default-handling outcome.

@kiftio
kiftio added this pull request to stack #853 September 29, 2026 08:43
@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Sep 29, 2026
@kiftio
kiftio force-pushed the swift-intercept-navigation-deep-links branch 2 times, most recently from df7d454 to 9ffbd6e Compare September 29, 2026 09:48
@kiftio
kiftio marked this pull request as ready for review September 29, 2026 10:15
@kiftio
kiftio requested a review from a team as a code owner September 29, 2026 10:15
@bitrise

bitrise Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Install this build

Open Tophat, select your target device, then click Install. Links open on the Mac running Tophat.

SDK Install
Swift Install with Tophat

Checkout Kit E2E results

Status Tags Target Platform OS version tag Device
✅ launch, checkout-presentation, checkout-completion, buyer-identity, preload swift ios latest iPhone 15
iOS 27 Beta

Base automatically changed from android-intercept-navigation-deep-links to main September 29, 2026 10:46
@kiftio
kiftio force-pushed the swift-intercept-navigation-deep-links branch from 9ffbd6e to 5c1ec99 Compare September 29, 2026 10:46
@kiftio
kiftio force-pushed the swift-intercept-navigation-deep-links branch from fb323d4 to f40a3e3 Compare October 1, 2026 15:34
@kiftio
kiftio merged commit 356558b into main Oct 1, 2026
31 of 32 checks passed
@kiftio
kiftio deleted the swift-intercept-navigation-deep-links branch October 1, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

#gsd:50662 Rebase Checkout Kit on UCP

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants