From 6e0cf89533bd50dcc49824a2467d2a9fe8e9642c Mon Sep 17 00:00:00 2001 From: Mark Murray Date: Thu, 24 Oct 2024 15:54:45 -0400 Subject: [PATCH] Upgrade Android dependency, add support for invalidate function --- .../@shopify/checkout-sheet-kit/android/gradle.properties | 2 +- .../checkoutsheetkit/ShopifyCheckoutSheetKitModule.java | 5 +++++ sample/src/screens/CartScreen.tsx | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/@shopify/checkout-sheet-kit/android/gradle.properties b/modules/@shopify/checkout-sheet-kit/android/gradle.properties index c4f65c7..9191da2 100644 --- a/modules/@shopify/checkout-sheet-kit/android/gradle.properties +++ b/modules/@shopify/checkout-sheet-kit/android/gradle.properties @@ -5,4 +5,4 @@ ndkVersion=23.1.7779620 buildToolsVersion = "33.0.0" # Version of Shopify Checkout SDK to use with React Native -SHOPIFY_CHECKOUT_SDK_VERSION=3.0.4 +SHOPIFY_CHECKOUT_SDK_VERSION=3.2.0 diff --git a/modules/@shopify/checkout-sheet-kit/android/src/main/java/com/shopify/reactnative/checkoutsheetkit/ShopifyCheckoutSheetKitModule.java b/modules/@shopify/checkout-sheet-kit/android/src/main/java/com/shopify/reactnative/checkoutsheetkit/ShopifyCheckoutSheetKitModule.java index 1304492..ef594da 100644 --- a/modules/@shopify/checkout-sheet-kit/android/src/main/java/com/shopify/reactnative/checkoutsheetkit/ShopifyCheckoutSheetKitModule.java +++ b/modules/@shopify/checkout-sheet-kit/android/src/main/java/com/shopify/reactnative/checkoutsheetkit/ShopifyCheckoutSheetKitModule.java @@ -112,6 +112,11 @@ public void preload(String checkoutURL) { } } + @ReactMethod + public void invalidateCache() { + ShopifyCheckoutSheetKit.invalidate(); + } + private ColorScheme getColorScheme(String colorScheme) { switch (colorScheme) { case "web_default": diff --git a/sample/src/screens/CartScreen.tsx b/sample/src/screens/CartScreen.tsx index 25e55a6..7b2bf01 100644 --- a/sample/src/screens/CartScreen.tsx +++ b/sample/src/screens/CartScreen.tsx @@ -78,6 +78,7 @@ function CartScreen(): React.JSX.Element { const presentCheckout = async () => { if (checkoutURL) { + ShopifyCheckout.invalidate(); ShopifyCheckout.present(checkoutURL); } };