From fe6f635b33d5cd91dff1ecc06af82ede56cd3df2 Mon Sep 17 00:00:00 2001
From: "promptless[bot]" <179508745+promptless[bot]@users.noreply.github.com>
Date: Sun, 23 Nov 2025 05:16:10 +0000
Subject: [PATCH] Document platform-specific purchase handlers for React Native
SDK
---
sdk/quickstart-react-native.mdx | 28 ++++++++++++++++++++++------
1 file changed, 22 insertions(+), 6 deletions(-)
diff --git a/sdk/quickstart-react-native.mdx b/sdk/quickstart-react-native.mdx
index 00a09cf..6051b48 100644
--- a/sdk/quickstart-react-native.mdx
+++ b/sdk/quickstart-react-native.mdx
@@ -154,9 +154,13 @@ import { createCustomPurchaseConfig } from 'expo-helium';
// In your initialize call:
purchaseConfig: createCustomPurchaseConfig({
- makePurchase: async (productId) => {
- // Your purchase logic here
- // Return a HeliumTransactionStatus
+ makePurchaseIOS: async (productId) => {
+ // Your iOS purchase logic here
+ return { status: 'purchased' };
+ },
+ makePurchaseAndroid: async (productId, basePlanId, offerId) => {
+ // Your Android purchase logic here
+ // basePlanId and offerId are for subscription offers
return { status: 'purchased' };
},
restorePurchases: async () => {
@@ -171,9 +175,13 @@ import { createCustomPurchaseConfig } from '@tryheliumai/paywall-sdk-react-nativ
// In your initialize call:
purchaseConfig: createCustomPurchaseConfig({
- makePurchase: async (productId) => {
- // Your purchase logic here
- // Return a HeliumTransactionStatus
+ makePurchaseIOS: async (productId) => {
+ // Your iOS purchase logic here
+ return { status: 'purchased' };
+ },
+ makePurchaseAndroid: async (productId, basePlanId, offerId) => {
+ // Your Android purchase logic here
+ // basePlanId and offerId are for subscription offers
return { status: 'purchased' };
},
restorePurchases: async () => {
@@ -184,6 +192,14 @@ purchaseConfig: createCustomPurchaseConfig({
```
+
+ **Android subscription parameters:** `basePlanId` and `offerId` are optional parameters for identifying subscription plans and promotional offers in Google Play. These are only passed on Android and will be `undefined` on iOS.
+
+
+
+ The deprecated `makePurchase` handler is still supported for backward compatibility, but we recommend using the platform-specific handlers (`makePurchaseIOS` and `makePurchaseAndroid`) instead.
+
+
```tsx
type HeliumTransactionStatus =
'purchased' | 'failed' | 'cancelled' | 'pending' | 'restored';