Activate UCP mode: append ec_version, and ec_color_scheme to checkout URL and update UA#38
Merged
tiagocandido merged 1 commit intoMay 13, 2026
Conversation
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
9740f88 to
37129c1
Compare
b7ef569 to
f22155a
Compare
4667dde to
3dacb21
Compare
markmur
approved these changes
May 13, 2026
3dacb21 to
7cf2e00
Compare
kiftio
reviewed
May 13, 2026
| entry.decode(request.params)?.let { payload -> | ||
| onMainThread { entry.invoke(payload) } | ||
| } | ||
| val entry = handlers[request.method] |
Contributor
There was a problem hiding this comment.
why do we call it entry, sounds like a handler from the name of the collection
Contributor
Author
There was a problem hiding this comment.
Renamed HandlerEntry → Handler and the local entry → handler. Reads much better.
29fad63 to
9c9bef3
Compare
kiftio
reviewed
May 13, 2026
9c9bef3 to
a159590
Compare
kiftio
approved these changes
May 13, 2026
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?
Activates Embedded Checkout Protocol (ECP) mode on Android by appending the required query params to the checkout URL before it is loaded into the WebView, and aligns the typed consumer client with Swift PR #65.
Without
ec_versionin the URL, checkout-web'sisLikelyEmbedFromUrl()returnsfalseand ECP mode never initialises —ec.ready,ec.start, and all other protocol messages are never sent to the native side.URL activation:
String.appendEcpParams(specVersion, colorScheme): pure extension onUriExtensions.kt, called fromCheckoutWebView.loadCheckout()beforeloadUrl(). Idempotently appends:ec_version— activates ECP mode in checkout-web.ec_color_scheme—lightordarkwhen an explicit scheme is configured; omitted forAutomaticandWeb.ec_delegate=window.open— delegates link opens to the native bridge viaec.window.open_request.BaseWebView.userAgentSuffix(): now uses string interpolation (no morebuildString) and produces the sameShopifyCheckoutKit/<version> (Android; Kotlin <kotlin>[ <platform>[/<version>]])token used as the WebView's User-Agent suffix.Platform: changed fromenum classtosealed classso each subtype can carry an instance-levelversion: String?.ReactNativegains an optional version argument (@JvmOverloadspreserves Java interop)."ShopifyCheckoutKit/x (Android; Kotlin y[ <platform>[/<version>]])"— aligns with browser UA conventions.Typed client alignment with Swift PR #65:
CheckoutProtocol.specVersion: corrected from unrecognised"2026-01-11"to"2026-04-08"(the version that supports unauthenticated ECP).CheckoutProtocol.readyandCheckoutProtocol.paymentChangedescriptors — neither is exposed by Swift PR Wire Swift kit for UCP events #65.ec.readyis fully handled insideEmbeddedCheckoutProtocol(ACK-only) andec.payment.changeonly fires when payment is delegated, which this SDK does not yet support.CheckoutProtocol.errordescriptor with a typedCheckoutErrorpayload (code,content,severity) decoded fromparams.messages[0].ExtendsSerializerfor theExtendssealed class so it accepts both the string shape ("extends": "dev.ucp.shopping.checkout") and the array shape the spec also allows. Without this,kotlinx.serialization's generated serializer threw on everyCheckoutpayload and no typed handler ever fired.BaseWebView.ECP_LOG_TAG = "CheckoutECP") across the bridge and the typed client; added a payload-decoded log line so consumers can see exactly what their handler is receiving.How to test
Unit tests (no device required):
Manual (sample app on device/emulator):
platforms/android/samples/MobileBuyIntegration.Received bridge message: method=ec.ready ...followed byec.start,ec.totals.change, etc., and aDecoded payload for method=...: Checkout(...)line for each typed handler.Before you merge
Important
platforms/swift/README.mdand/orplatforms/android/README.md)Releasing a new Swift version?
platforms/swift/ShopifyCheckoutKit.podspecplatforms/swift/Sources/ShopifyCheckoutKit/ShopifyCheckoutKit.swiftplatforms/swift/CHANGELOG.mdplatforms/swift/README.md(major version only)Releasing a new Android version?
versionNameinplatforms/android/lib/build.gradleplatforms/android/CHANGELOG.mdplatforms/android/README.mdTip
See the Contributing documentation for the full release process per platform.