---
title: "iOS - Utiliser les fallbacks"
description: "Gérez les cas où les utilisateurs sont hors ligne ou les serveurs Adapty ne sont pas disponibles"
---

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 le fichier JSON de secours à votre bundle de projet : ouvrez le menu **File** dans XCode et sélectionnez l'option **Add Files to "YourProjectName"**.
2. Appelez la méthode `.setFallback` **avant** de récupérer le flow, le paywall ou l'onboarding cible.

<Tabs groupId="current-os" queryString>
<TabItem value="swift" label="Swift" default>

```swift showLineNumbers
do {
     if let urlPath = Bundle.main.url(forResource: fileName, withExtension: "json") {
          try await Adapty.setFallback(fileURL: urlPath)
     }
} catch {
    // handle the error
}
```
</TabItem>
<TabItem value="swift-callback" label="Swift-Callback" default>

```swift showLineNumbers
if let url = Bundle.main.url(forResource: "ios_fallback", withExtension: "json") {
     Adapty.setFallback(fileURL: url)
}
```
</TabItem>
</Tabs>

Paramètres :

| Paramètre   | Description                                                                                                                                                                       |
| :---------- |:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| **fileURL** | Chemin vers le fichier de configuration de secours. |