Skip to content

Android: hardware back on Thank You Page navigates checkout WebView to storefront/login instead of closing the sheet #508

Description

@sreehariv-code

What area is the issue related to?

Checkout Sheet Kit

What platform does the issue affect?

Android

What version of @shopify/checkout-sheet-kit are you using?

@shopify/checkout-sheet-kit@3.2.0 (bundles native Android com.shopify:checkout-sheet-kit 3.3.0; iOS pod ~> 3.1.2). React Native 0.79.5, Expo 53.0.22. Device: Android emulator (Pixel 8 Pro, API level as shipped) and physical Android devices.

Do you have reproducible example code?

Standard integration — shopifyCheckout.present(checkoutUrl) with addEventListener for 'completed' / 'close' / 'pixel'. No custom back-button handling on our side; the behavior comes entirely from the native sheet.

Steps to Reproduce

  1. Present the checkout sheet on Android via present(checkoutUrl).
  2. Complete an order (e.g. Bogus Gateway card 1) so the sheet reaches the Thank You / order-status page.
  3. Press the hardware/system back button on the Thank You page.

Expected Behavior

Back on the Thank You page should close the checkout sheet and return the user to the app, since the checkout is already complete.

Actual Behavior

The sheet does not close. The internal WebView performs goBack() in its history, and because the checkout URL is already consumed, Shopify redirects to the mobile-web storefront /account/login page — shown inside the still-open sheet. The user is stranded on mWeb inside the checkout sheet.

Root cause is native: BaseWebView.onKeyDown calls goBack() whenever canGoBack() is true, with no confirmation-page check, so the sheet only dismisses once history is exhausted.

This already appears fixed on checkout-sheet-kit-android main via PR #520 "fix swipe back on TYP" (merged 2026-04-20), which adds BaseWebView.handleBackPressed() + Uri.isConfirmationPage(). However it is not in any published Android release (latest 3.5.4 predates it), and the RN wrapper still pins SHOPIFY_CHECKOUT_SDK_VERSION=3.5.3 even on main (our env resolves 3.3.0 via @shopify/checkout-sheet-kit@3.2.0) — so upgrading the RN package (even to 3.8.1) does not pick up the fix.

Request:

  1. Publish an Android checkout-sheet-kit release that includes PR #520.
  2. Bump SHOPIFY_CHECKOUT_SDK_VERSION in @shopify/checkout-sheet-kit (RN) to that release.
  3. Is an iOS equivalent planned? (Could not reproduce on iOS — no in-WebView back key.)
    Any ETA for the release + RN version bump would help us decide between waiting vs a temporary app-side workaround.

Storefront domain

Reproducible on any Checkout Extensibility store (confirmed with Bogus Gateway in test mode).

Screenshots/Videos/Log output

Captured [CS_EVENT] sequence on Android (successful order):

pixel  checkout_started
pixel  payment_info_submitted
completed            ← lifecycle event (order placed)
pixel  page_viewed          ← thank-you page
pixel  checkout_completed   ← thank-you rendered

On pressing hardware back at this point, the sheet stays open and navigates to the mWeb /account/login page instead of closing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions