From c66a5a186b01fd95b11fb56a1e82d2e6c840ea42 Mon Sep 17 00:00:00 2001 From: Claude Code Date: Tue, 14 Apr 2026 16:12:43 +0000 Subject: [PATCH 1/2] feat(expo): update for 1.0.11 --- content/docs/expo/index.mdx | 2 +- content/docs/expo/sdk-reference/index.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/docs/expo/index.mdx b/content/docs/expo/index.mdx index 85909ce..7fdde94 100644 --- a/content/docs/expo/index.mdx +++ b/content/docs/expo/index.mdx @@ -47,4 +47,4 @@ If you have feedback on any of our docs, please leave a rating and message at th If you have any issues please [open an issue on GitHub](https://github.com/superwall/expo-superwall/issues). - + diff --git a/content/docs/expo/sdk-reference/index.mdx b/content/docs/expo/sdk-reference/index.mdx index ddf243b..5072b5e 100644 --- a/content/docs/expo/sdk-reference/index.mdx +++ b/content/docs/expo/sdk-reference/index.mdx @@ -15,4 +15,4 @@ If you have feedback on any of our docs, please leave a rating and message at th If you have any issues with the SDK, please [open an issue on GitHub](https://github.com/superwall/expo-superwall/issues). - + From 99cdc9c695c5dbc91876adf38a550ae46e0ddd13 Mon Sep 17 00:00:00 2001 From: Duncan Crawbuck Date: Tue, 14 Apr 2026 12:28:41 -0700 Subject: [PATCH 2/2] docs(expo): address 1.0.11 review feedback --- content/docs/expo/changelog.mdx | 19 +++++++ content/docs/expo/meta.json | 3 +- .../docs/expo/sdk-reference/hooks/consume.mdx | 53 +++++++++++++++++++ .../{ => hooks}/getPresentationResult.mdx | 0 .../docs/expo/sdk-reference/hooks/meta.json | 4 +- .../expo/sdk-reference/hooks/usePlacement.mdx | 5 +- .../expo/sdk-reference/hooks/useSuperwall.mdx | 41 +++++++++++++- .../docs/expo/sdk-reference/hooks/useUser.mdx | 22 +++++++- 8 files changed, 140 insertions(+), 7 deletions(-) create mode 100644 content/docs/expo/sdk-reference/hooks/consume.mdx rename content/docs/expo/sdk-reference/{ => hooks}/getPresentationResult.mdx (100%) diff --git a/content/docs/expo/changelog.mdx b/content/docs/expo/changelog.mdx index eecbe22..8e6d989 100644 --- a/content/docs/expo/changelog.mdx +++ b/content/docs/expo/changelog.mdx @@ -5,6 +5,25 @@ description: "Release notes for the Superwall Expo SDK" # Changelog +## 1.0.11 + +### Patch Changes + +- 975de31: Add android 'consume' method +- 2204ee8: Bump Android version + +## 1.0.10 + +### Patch Changes + +- 9d23138: Replace any in getPresentation result, improve chaining on delegate + +## 1.0.9 + +### Patch Changes + +- 836249d: Fix `useSuperwallEvents` so non-interactive Superwall callbacks are not dropped on first app launch before React listeners mount. + ## 1.0.8 ### Patch Changes diff --git a/content/docs/expo/meta.json b/content/docs/expo/meta.json index cdf4c6b..03a9b0c 100644 --- a/content/docs/expo/meta.json +++ b/content/docs/expo/meta.json @@ -23,7 +23,6 @@ "---SDK Reference---", "sdk-reference/index", - "sdk-reference/getPresentationResult", "sdk-reference/components", "sdk-reference/hooks", @@ -42,4 +41,4 @@ "[Troubleshooting](https://support.superwall.com/articles/4780985851-troubleshooting-expo-sdk)", "[Example App](https://github.com/superwall/expo-superwall/tree/main/example)" ] -} \ No newline at end of file +} diff --git a/content/docs/expo/sdk-reference/hooks/consume.mdx b/content/docs/expo/sdk-reference/hooks/consume.mdx new file mode 100644 index 0000000..22806ed --- /dev/null +++ b/content/docs/expo/sdk-reference/hooks/consume.mdx @@ -0,0 +1,53 @@ +--- +title: "consume()" +description: "Consume a Google Play purchase token from the Expo compat API." +--- + +## Purpose +Consumes a Google Play purchase token so the item can be purchased again. This is mainly for consumable Android purchases. The method is exposed on the Expo compat `Superwall` API and is Android-only; it is not supported on iOS. + +## Signature +```ts +import Superwall from "expo-superwall/compat" + +await Superwall.consume( + purchaseToken: string +): Promise +``` + +## Parameters + + + +## Returns / State +Returns a `Promise` that resolves to the consumed purchase token. + +The promise rejects if: +- you call it before `Superwall.configure()` completes, +- or the native Android consume operation fails. + +## Usage +```tsx +import Superwall from "expo-superwall/compat" + +async function consumePurchase(purchaseToken: string) { + try { + const token = await Superwall.consume(purchaseToken) + console.log("Purchase consumed:", token) + } catch (error) { + console.error("Failed to consume purchase:", error) + } +} +``` + +## Related +- [`useSuperwall`](/expo/sdk-reference/hooks/useSuperwall) - Hook access to the main Expo SDK store. +- [`getPresentationResult()`](/expo/sdk-reference/hooks/getPresentationResult) - Another Expo compat API surface with dedicated reference docs. diff --git a/content/docs/expo/sdk-reference/getPresentationResult.mdx b/content/docs/expo/sdk-reference/hooks/getPresentationResult.mdx similarity index 100% rename from content/docs/expo/sdk-reference/getPresentationResult.mdx rename to content/docs/expo/sdk-reference/hooks/getPresentationResult.mdx diff --git a/content/docs/expo/sdk-reference/hooks/meta.json b/content/docs/expo/sdk-reference/hooks/meta.json index d1a1903..88fc2bd 100644 --- a/content/docs/expo/sdk-reference/hooks/meta.json +++ b/content/docs/expo/sdk-reference/hooks/meta.json @@ -1,9 +1,11 @@ { "defaultOpen": true, "pages": [ + "getPresentationResult", + "consume", "usePlacement", "useUser", "useSuperwall", "..." ] -} \ No newline at end of file +} diff --git a/content/docs/expo/sdk-reference/hooks/usePlacement.mdx b/content/docs/expo/sdk-reference/hooks/usePlacement.mdx index 7607bd5..26a3de8 100644 --- a/content/docs/expo/sdk-reference/hooks/usePlacement.mdx +++ b/content/docs/expo/sdk-reference/hooks/usePlacement.mdx @@ -66,7 +66,7 @@ function usePlacement( }, feature: { type: "() => void", - description: "Optional function executed **only** if no paywall is shown (the user is allowed through).", + description: "Optional function queued when you register the placement. It runs if presentation is skipped, or after the paywall dismisses with `purchased` or `restored`. It does not run on paywall errors or other dismiss results.", }, }} /> @@ -131,7 +131,8 @@ export default function PremiumButton() { await registerPlacement({ placement: "MyFeaturePlacement", feature: () => { - // User was allowed through without a paywall + // Runs when the user is allowed through immediately, + // or after a purchased/restored paywall dismissal. navigateToPremiumFeature() }, }) diff --git a/content/docs/expo/sdk-reference/hooks/useSuperwall.mdx b/content/docs/expo/sdk-reference/hooks/useSuperwall.mdx index a338f03..6eed9b5 100644 --- a/content/docs/expo/sdk-reference/hooks/useSuperwall.mdx +++ b/content/docs/expo/sdk-reference/hooks/useSuperwall.mdx @@ -62,6 +62,10 @@ The hook returns an object representing the Superwall store. If a `selector` fun type: "(placement: string, params?: Record) => Promise", description: "Gets the presentation result for a placement without presenting.", }, + restorePurchases: { + type: "() => Promise", + description: "Programmatically restores purchases and returns whether the restore succeeded or failed.", + }, dismiss: { type: "() => Promise", description: "Dismisses any currently presented paywall.", @@ -104,7 +108,7 @@ The hook returns an object representing the Superwall store. If a `selector` fun }, getEntitlements: { type: "() => Promise", - description: "Fetches active and inactive entitlements for the user.", + description: "Fetches the user's entitlement snapshot, including active and inactive entitlements, plus all known entitlements when exposed by the native bridge.", }, }} /> @@ -160,6 +164,41 @@ The hook returns an object representing the Superwall store. If a `selector` fun }} /> +### EntitlementsInfo + + +### RestorationResultResponse + + ## Example (Direct Usage - Advanced) diff --git a/content/docs/expo/sdk-reference/hooks/useUser.mdx b/content/docs/expo/sdk-reference/hooks/useUser.mdx index 1d6d670..71a74bf 100644 --- a/content/docs/expo/sdk-reference/hooks/useUser.mdx +++ b/content/docs/expo/sdk-reference/hooks/useUser.mdx @@ -35,7 +35,7 @@ The `useUser` hook provides a convenient way to manage user identity and attribu }, getEntitlements: { type: "() => Promise", - description: "Fetches active and inactive entitlements for the user.", + description: "Fetches the user's entitlement snapshot, including active and inactive entitlements, plus all known entitlements when exposed by the native bridge.", }, setSubscriptionStatus: { type: "(status: SubscriptionStatus) => Promise", @@ -78,6 +78,26 @@ The `useUser` hook provides a convenient way to manage user identity and attribu }} /> +### EntitlementsInfo + + ### UserAttributes