Skip to content

[RN][Refactor]: Rename React Native dismissal callbacks to onDismiss - #749

Draft
kieran-osgood-shopify wants to merge 1 commit into
swift-accelerated-checkout-dismissalsfrom
rn-ondismiss
Draft

kieran-osgood-shopify wants to merge 1 commit into
swift-accelerated-checkout-dismissalsfrom
rn-ondismiss

Conversation

@kieran-osgood-shopify

@kieran-osgood-shopify kieran-osgood-shopify commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

What changes are you making?

Closes https://github.com/shop/issues-checkout-kit/issues/1261

Rename the React Native checkout dismissal callbacks to use one public API name:

  • PresentCallbacks.onCloseonDismiss
  • AcceleratedCheckoutButtons.onCancelonDismiss

This is an intentional breaking rename without compatibility aliases. The private native lifecycle event remains close.

Document and test that checkout completion and presentation dismissal are separate events: CheckoutProtocol.complete reports order completion, while onDismiss reports a later buyer dismissal. Programmatic dismiss() invokes neither onDismiss nor onFail.

Register accelerated checkout's onDismiss as a direct native event. React Native already reserves topDismiss as a direct event for modal dismissal; registering it as bubbling caused an event-type collision and an iOS RedBox during app startup.

Update the sample, API report, README, JavaScript tests, and iOS integration coverage.

How to test

GIVEN the React Native sample is configured with a storefront and has an item in the cart

WHEN the reviewer taps Checkout and closes the checkout presentation before completing payment

THEN the sample should log onDismiss once and return to the cart without invoking onFail


GIVEN the React Native sample is configured with a storefront, has an item in the cart, and can complete a test payment

WHEN the reviewer completes checkout and then dismisses the confirmation presentation

THEN CheckoutProtocol.complete should be logged when the order completes, followed by onDismiss only when the buyer dismisses the presentation


GIVEN the iOS React Native sample is built with the New Architecture and launched on iOS 16 or newer

WHEN the reviewer opens the catalog and navigates to the cart

THEN the app should render without a RedBox reporting that RCTAcceleratedCheckoutButtons re-registered topDismiss as a bubbling event


GIVEN the Android React Native sample is built with the New Architecture

WHEN the reviewer launches the app and opens the catalog

THEN the app should render without a LogBox warning about topDismiss being registered as both a direct and bubbling event


Before you merge

Important

  • I've added tests to support my implementation
  • I have read and agree with the Contribution Guidelines
  • I have read and agree with the Code of Conduct
  • I've updated the relevant platform README (platforms/react-native/README.md)

Releasing a new Swift version?
  • I have bumped the version in ShopifyCheckoutKit.podspec
  • I have bumped the version in platforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swift
  • I have updated the SwiftPM/CocoaPods version snippets in platforms/swift/README.md (major version only)
Releasing a new Embedded Checkout Protocol version?
  • I have bumped embeddedCheckoutProtocolAndroid in platforms/android/gradle/libs.versions.toml
  • I have updated protocol/languages/kotlin/embedded-checkout-protocol/api/embedded-checkout-protocol.api if the public API changed
Releasing a new Android version?
  • I have bumped checkoutKitAndroid in platforms/android/gradle/libs.versions.toml
  • I have updated the Gradle/Maven version snippets in platforms/android/README.md

Tip

See the Contributing documentation for the full release process per platform.

@github-actions github-actions Bot added the #gsd:50662 Rebase Checkout Kit on UCP label Sep 8, 2026
@kieran-osgood-shopify
kieran-osgood-shopify changed the base branch from main to swift-accelerated-checkout-dismissals September 11, 2026 09:24
@kieran-osgood-shopify
kieran-osgood-shopify added this pull request to stack #763 September 11, 2026 09:24
Assisted-By: devx/3f0e7f93-212d-45d8-b056-138b2da8389f
@kieran-osgood-shopify kieran-osgood-shopify changed the title Rename React Native dismissal callbacks to onDismiss [RN][Refactor]: Rename React Native dismissal callbacks to onDismiss Sep 14, 2026
* Presents the checkout sheet for a given checkout URL.
*
* Exactly one of `callbacks.onClose` or `callbacks.onFail` fires per
* At most one of `callbacks.onDismiss` or `callbacks.onFail` fires per

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

🟡 Before this PR is merged, update checkoutKit.nativeSdkVersions.ios and .android in package.json to 4.0.0-alpha.7 after those native artifacts are published. This lifecycle contract depends on the alpha.7 native dismissal behavior.

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.

1 participant