Superwall

Setting a Locale

Override the default device locale when using the Expo SDK so you can preview localized paywalls and targeting.

Overview

The Expo SDK automatically uses the device's locale to localize paywalls and evaluate campaign rules. Override the locale with the localeIdentifier option when you need to:

  • preview translations without changing the simulator or device settings
  • QA rules that gate content by market or language
  • capture store screenshots or marketing assets in a specific language

localeIdentifier accepts standard BCP‑47 identifiers such as en_US, en_GB, or fr_CA. You can reference Apple's complete locale list if you need the exact identifier for a region.

Set the locale before Superwall config

<SuperwallProvider /> configures the native SDK only once, so be sure the locale you want to test is decided before the provider mounts.

import { SuperwallProvider, type PartialSuperwallOptions } from "expo-superwall";

const localeOptions: PartialSuperwallOptions = {
  localeIdentifier: "fr_FR",
};

export default function App() {
  return (
    <SuperwallProvider
      apiKeys={{
        ios: process.env.EXPO_PUBLIC_SUPERWALL_IOS_KEY!,
        android: process.env.EXPO_PUBLIC_SUPERWALL_ANDROID_KEY!,
      }}
      options={localeOptions}
    >
      <RootNavigator />
    </SuperwallProvider>
  );
}

Verify the active locale

Use useSuperwall() and getDeviceAttributes() to confirm which locale the native SDK currently sees. This is helpful when debugging targeting issues.

import { useEffect } from "react";
import { useSuperwall } from "expo-superwall";

export function LocaleDebug() {
  const superwall = useSuperwall();

  useEffect(() => {
    superwall.getDeviceAttributes().then((attrs) => {
      console.log("[Superwall] localeIdentifier:", attrs.localeIdentifier);
    });
  }, [superwall]);

  return null;
}

How is this guide?

Edit on GitHub