---
title: "Kotlin Multiplatform - Use fallback paywalls"
description: "Handle cases when users are offline or Adapty servers aren't available"
---

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

1. Add the fallback configuration file to your application.

    * If your target platform is Android, move the fallback configuration file to the `android/app/src/main/assets/` folder.
    * If your target platform is iOS, add the fallback JSON file to your project bundle. (**File** -> **Add Files to YourProjectName**)

2. Call the `.setFallback` method **before** you fetch the target flow, paywall, or onboarding.
3. Set the `assetId` parameter, depending on your target platform.
    * Android: Use the file path relative to the `assets` directory.
    * iOS: Use the complete filename.

```kotlin showLineNumbers

Adapty.setFallback(assetId = "fallback.json")
    .onSuccess { 
        // Fallback paywalls loaded successfully
    }
    .onError { error ->
        // Handle the error
    }
```
:::important
`setFallback` must run before the SDK fetches the target flow, paywall, or onboarding.
:::

Parameters:

| Parameter   | Description                                                                                                                                                                       |
| :---------- |:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **assetId** | Fallback configuration filename (iOS). <br /> Fallback configuration file path, relative to the `assets` directory (Android). |

:::tip

Want to see a real-world example of how Adapty SDK is integrated into a mobile app? Check out our [sample apps](sample-apps), which demonstrate the full setup, including displaying paywalls, making purchases, and other basic functionality.

:::