Skip to content

Cancel WKWebView navigation for externally-opened deep links#292

Open
markmur wants to merge 1 commit into
mainfrom
swift-deeplink-cancel
Open

Cancel WKWebView navigation for externally-opened deep links#292
markmur wants to merge 1 commit into
mainfrom
swift-deeplink-cancel

Conversation

@markmur

@markmur markmur commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Embedded checkout hands non-HTTP(S) deep links (tel:, mailto:, app/wallet schemes) to the OS via UIApplication.shared.open, but then returned .allow, so WKWebView also tried to navigate to a scheme it can't load.

That redundant navigation fails - usually a swallowed provisional error that clears the load timer and can blank the current (often offsite payment) page, occasionally a spurious .sdkError surfaced to the merchant, and on some iOS versions a second app-switch. Since the URL is already delegated to the OS, the success branch now returns .cancel. The open/can-open calls are behind injectable hooks so the branch is unit-testable without firing a real system open.

@markmur markmur requested a review from a team as a code owner June 17, 2026 11:02
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

React Native — Coverage Report

Lines Statements Branches Functions
Coverage: 92%
91.66% (319/348) 87.86% (181/206) 100% (82/82)

@markmur markmur self-assigned this Jun 17, 2026
@markmur markmur force-pushed the swift-deeplink-cancel branch 2 times, most recently from ef12abd to 00668b5 Compare June 17, 2026 11:54
@markmur markmur force-pushed the swift-deeplink-cancel branch from 00668b5 to 73c3d60 Compare June 17, 2026 12:01

@kieran-osgood-shopify kieran-osgood-shopify left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Might be worth a call out in our ReadMe too but looks good!

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