Skip to content

Add clickLink event for intercepting checkout link clicks - #517

Draft
tiagocandido wants to merge 2 commits into
mainfrom
clicklink-event
Draft

Add clickLink event for intercepting checkout link clicks#517
tiagocandido wants to merge 2 commits into
mainfrom
clicklink-event

Conversation

@tiagocandido

Copy link
Copy Markdown

What changes are you making?

Adds a new clickLink event that lets host apps intercept links clicked within checkout that would otherwise be opened outside of it (in the system browser, mail, or phone app).

The native kits already expose this through checkoutDidClickLink (iOS) and onCheckoutLinkClicked (Android), but the bridge never forwarded it to JS. This wires it through on both platforms.

Native interception is only active while at least one clickLink listener is attached: JS counts subscriptions and toggles a native flag via a new setClickLinkInterceptionEnabled method (on 0→1 add, off when the last listener is removed). Apps that don't subscribe keep the current default of opening links externally — no behavior change unless you opt in.

Fixes #516


PR Checklist

Important

Releasing a new version of the kit?


Tip

See the Contributing documentation for instructions on how to publish a new version of the library.

Bridges the native checkoutDidClickLink / onCheckoutLinkClicked delegate
callbacks to JS as a new 'clickLink' event, letting host apps handle
links clicked within checkout that would otherwise be opened outside of
it.

Native interception is only enabled while at least one 'clickLink'
listener is attached, driven by JS-side listener counting through a new
setClickLinkInterceptionEnabled native method. Apps that don't subscribe
keep the SDK's default behavior of opening links externally.

Fixes #516
@github-actions

Copy link
Copy Markdown

Coverage Report

Lines Statements Branches Functions
Coverage: 99%
99.57% (237/238) 96.35% (132/137) 100% (66/66)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant