Add clickLink event for intercepting checkout link clicks - #517
Draft
tiagocandido wants to merge 2 commits into
Draft
Add clickLink event for intercepting checkout link clicks#517tiagocandido wants to merge 2 commits into
tiagocandido wants to merge 2 commits into
Conversation
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
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.
What changes are you making?
Adds a new
clickLinkevent 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) andonCheckoutLinkClicked(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
clickLinklistener is attached: JS counts subscriptions and toggles a native flag via a newsetClickLinkInterceptionEnabledmethod (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?
package.jsonfile.Tip
See the Contributing documentation for instructions on how to publish a new version of the library.