From 095b20e40c0819cae5ed878050a7174adc23c14d Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 26 May 2026 16:07:34 +0000 Subject: [PATCH 1/2] feat(expo): update for 1.1.3 --- content/docs/expo/changelog.mdx | 6 ++++ content/docs/expo/guides/configuring.mdx | 35 +++++++++++++++++++++++ content/docs/expo/index.mdx | 2 +- content/docs/expo/sdk-reference/index.mdx | 2 +- 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/content/docs/expo/changelog.mdx b/content/docs/expo/changelog.mdx index 3a9a4a28..1e9bf477 100644 --- a/content/docs/expo/changelog.mdx +++ b/content/docs/expo/changelog.mdx @@ -5,6 +5,12 @@ description: "Release notes for the Superwall Expo SDK" # Changelog +## 1.1.3 + +### Patch Changes + +- a8ba5af: Add localResources resolving for expo + ## 1.1.2 ### Patch Changes diff --git a/content/docs/expo/guides/configuring.mdx b/content/docs/expo/guides/configuring.mdx index 68b8a5db..26dd2db3 100644 --- a/content/docs/expo/guides/configuring.mdx +++ b/content/docs/expo/guides/configuring.mdx @@ -33,6 +33,10 @@ Expo apps inherit the native Superwall option surface. The following fields were description: "Controls when the SDK enters test mode. When active, purchases are simulated and product data is retrieved from the Superwall dashboard. Set to \"always\" during development to test your entire paywall flow without StoreKit or Play Store.", default: '"automatic"', }, + localResources: { + type: "Record", + description: "A mapping of local resource IDs to local assets. The paywall webview can reference these via the `swlocal://` URL scheme. Accepts a Metro `require()` result, a file URI string, or a `{ uri: string }` object. Resolved at configure time.", + }, }} /> @@ -56,4 +60,35 @@ export function App() { } ``` +### Local Resources + +Added in 1.1.3. Use `localResources` to serve local assets to the paywall webview via the `swlocal://` URL scheme. This allows you to reference bundled images or files directly in paywall designs without hosting them remotely. + +```tsx +import * as FileSystem from "expo-file-system"; +import { SuperwallProvider } from "expo-superwall"; + +export function App() { + return ( + + {/* your app */} + + ); +} +``` + +Each value accepts: +- A Metro `require()` result (e.g. `require("./hero.png")`) — resolved via `expo-asset` +- A string URI: `file://`, `content://`, or an absolute path +- A `{ uri: string }` object (matches React Native `Image` source format) + ../../../shared/configuring/using-superwalloptions.mdx diff --git a/content/docs/expo/index.mdx b/content/docs/expo/index.mdx index bd5df228..6a4a61ba 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 3ccc7f1f..ef682ebb 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 d2263d19fcb7c022d7200dc57c0637677df3b7af Mon Sep 17 00:00:00 2001 From: Duncan Crawbuck Date: Tue, 26 May 2026 14:44:32 -0700 Subject: [PATCH 2/2] docs(expo): add Local Resources guide for parity with ios/android Adds a dedicated Local Resources guide for the Expo SDK that mirrors the ios/android structure, with :::expo blocks in the shared partial covering registration, supported source types, and provider setup. Scopes the partial's Related links per-SDK so they resolve correctly for each platform. --- content/docs/expo/guides/configuring.mdx | 31 ----------- content/docs/expo/guides/local-resources.mdx | 6 +++ content/docs/expo/meta.json | 1 + content/shared/local-resources.mdx | 54 ++++++++++++++++++++ 4 files changed, 61 insertions(+), 31 deletions(-) create mode 100644 content/docs/expo/guides/local-resources.mdx diff --git a/content/docs/expo/guides/configuring.mdx b/content/docs/expo/guides/configuring.mdx index 26dd2db3..f225a2be 100644 --- a/content/docs/expo/guides/configuring.mdx +++ b/content/docs/expo/guides/configuring.mdx @@ -60,35 +60,4 @@ export function App() { } ``` -### Local Resources - -Added in 1.1.3. Use `localResources` to serve local assets to the paywall webview via the `swlocal://` URL scheme. This allows you to reference bundled images or files directly in paywall designs without hosting them remotely. - -```tsx -import * as FileSystem from "expo-file-system"; -import { SuperwallProvider } from "expo-superwall"; - -export function App() { - return ( - - {/* your app */} - - ); -} -``` - -Each value accepts: -- A Metro `require()` result (e.g. `require("./hero.png")`) — resolved via `expo-asset` -- A string URI: `file://`, `content://`, or an absolute path -- A `{ uri: string }` object (matches React Native `Image` source format) - ../../../shared/configuring/using-superwalloptions.mdx diff --git a/content/docs/expo/guides/local-resources.mdx b/content/docs/expo/guides/local-resources.mdx new file mode 100644 index 00000000..35e76ed9 --- /dev/null +++ b/content/docs/expo/guides/local-resources.mdx @@ -0,0 +1,6 @@ +--- +title: "Local Resources" +description: "Bundle images, videos, and other assets in your app so paywalls can load them instantly from the device." +--- + +../../../shared/local-resources.mdx diff --git a/content/docs/expo/meta.json b/content/docs/expo/meta.json index a9b82b3e..fdee69c0 100644 --- a/content/docs/expo/meta.json +++ b/content/docs/expo/meta.json @@ -36,6 +36,7 @@ "guides/managing-users", "guides/experimental-flags", "guides/testing-purchases", + "guides/local-resources", "guides/setting-locale", "guides/advanced", "guides/migrations", diff --git a/content/shared/local-resources.mdx b/content/shared/local-resources.mdx index f77908ea..f7ef0919 100644 --- a/content/shared/local-resources.mdx +++ b/content/shared/local-resources.mdx @@ -17,6 +17,12 @@ Local resources let your paywalls load bundled assets directly from the device i ::: +:::expo + + Local resources require **Expo SDK v1.1.3+**. + +::: + ## Registering local resources Choose a stable resource ID for each asset you want to serve locally. That same ID is what you'll select in the [paywall editor](/dashboard/dashboard-creating-paywalls/paywall-editor-local-resources) when configuring image or video components. @@ -80,6 +86,37 @@ class MyApplication : Application() { ::: +:::expo +On Expo, pass `localResources` in the `options` prop on `SuperwallProvider`. Entries are resolved during configuration — Metro `require()` results are downloaded via `expo-asset` so the webview can read them from a `file://` URI. + +```tsx Expo +import * as FileSystem from "expo-file-system" +import { SuperwallProvider } from "expo-superwall" + +export function App() { + return ( + + {/* your app */} + + ) +} +``` + + + `localResources` is resolved when `SuperwallProvider` configures the SDK. Resources added later + will not be available to paywalls that already loaded. + +::: + ## Supported source types :::ios @@ -99,6 +136,16 @@ Android supports two local resource source types: | `PaywallResource.FromUri(uri)` | Files addressed by a `Uri`, such as files in app storage or content provider URLs | ::: +:::expo +Each entry in `localResources` accepts one of: + +| Type | Use for | +| ---- | ------- | +| `number` (Metro `require()`) | Bundled assets in your Expo project; resolved through `expo-asset` | +| `string` | A `file://`, `content://`, or absolute path URI | +| `{ uri: string }` | The same shape used by React Native `Image` sources | +::: + ## Choosing resource IDs Resource IDs are the contract between your app and the paywall editor. A few guidelines: @@ -130,6 +177,13 @@ If a resource ID does not appear in the editor or fails to load: ## Related +:::ios - [iOS `localResources`](/sdk/sdk-reference/localResources): SDK reference for the iOS property. +::: +:::android - [Android `localResources`](/sdk/sdk-reference/localResources): SDK reference for the Android property. +::: +:::expo +- [Configuring the SDK](/expo/guides/configuring): Where `localResources` lives in the Expo options surface. +::: - [Paywall Editor: Local Resources](/dashboard/dashboard-creating-paywalls/paywall-editor-local-resources): How to assign local resource IDs in the dashboard.