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

:::warning
Les paywalls de secours sont pris en charge par le SDK Unity v2.11 et versions ultérieures.
:::

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 \{#configuration\}

1. Ajoutez les fichiers de configuration de secours dans le répertoire commun `Assets/StreamingAssets` de votre projet.
2. Appelez la méthode `.SetFallback` **avant** de récupérer le flow, le paywall ou l'onboarding cible.

```csharp
using UnityEngine;
using AdaptySDK;

#if UNITY_IOS
    string fileName = "ios_fallback.json";
#elif UNITY_ANDROID
    string fileName = "android_fallback.json";
#else
    // Optional: handle Editor or other platforms
    string fileName = "fallback.json"; 
#endif

Adapty.SetFallback(fileName, (error) => {
    if (error != null) {
        Debug.LogError($"Failed to set fallback: {error}");
        return;
    }
    
    // Fallback set successfully
});
```

:::important
`SetFallback` doit être exécuté avant que le SDK récupère le flow, le paywall ou l'onboarding cible.
:::

Paramètres :

| Paramètre    | Description                                          |
|:-------------|:-----------------------------------------------------|
| **fileName** | La chaîne contenant le nom du fichier de configuration de secours. |