---
title: "Use fallback paywalls in a pure React Native project"
description: "Configure fallback paywalls in a pure React Native (non-Expo) project."
---

:::important
This guide applies to **pure React Native (non-Expo) projects**.
If you're using **Expo**, follow the [Expo fallback guide](react-native-use-fallback-paywalls-expo) instead.
:::

To maintain a fluid user experience, it is important to set up [fallbacks](/fallback-paywalls) for your flows, [paywalls](paywalls), and [onboardings](onboardings). This precaution extends the application's capabilities in case of partial or complete loss of internet connection.

* **If the application cannot access Adapty servers:**

    It will be able to display a fallback flow or paywall, and access the local onboarding configuration.

* **If the application cannot access the internet:**

    It will be able to display a fallback flow or paywall. Onboardings include remote content and require an internet connection to function.

:::important
Before you follow the steps in this guide, [download](/local-fallback-paywalls) the fallback configuration files from Adapty.
:::

## Configuration

### Android

1. Add the fallback configuration file to your application. Select one of the following directories:
   * **android/app/src/main/assets/**
   * **android/app/src/main/res/raw/**

      Note: The `res/raw` folder has a special file naming convention (start with a letter, no capital letters, no special characters except for the underscore, and no spaces in the names).

2. Update the `android` property of the `FileLocation` constant:
   * If the file is located in the `assets` directory, pass the file's path relative to the directory.
   * If the file is located in the `res/raw` directory, pass the name of the file without the extension.

### iOS

1. Add the fallback JSON file to your project bundle: open the **File** menu in XCode and select the **Add Files to "YourProjectName"** option.
2. Pass the name of your configuration file to the `ios` property of the `FileLocation` constant.

## Example

<Tabs groupId="current-os" queryString> <TabItem value="current" label="Current (v3.8+)" default>
```typescript showLineNumbers
//after v3.8
const fileLocation = {
  ios: {
    fileName: 'ios_fallback.json'
  },
  android: {
    //if the file is located in 'android/app/src/main/assets/'
    relativeAssetPath: 'android_fallback.json'
  }
}
await adapty.setFallback(fileLocation);
```
</TabItem>
<TabItem value="old" label="Legacy (before v3.8)" default>
```typescript showLineNumbers
//Legacy (before v3.8)
const paywallsLocation = {
  ios: {
    fileName: 'ios_fallback.json'
  },
  android: {
    //if the file is located in 'android/app/src/main/assets/'
    relativeAssetPath: 'android_fallback.json'
  }
}
await adapty.setFallbackPaywalls(paywallsLocation);
```
</TabItem>
</Tabs>

Parameters:

| Parameter            | Description                                              |
| :------------------- | :------------------------------------------------------- |
| **fileLocation** | Object that represents the location of the fallback configuration file. |