# iOS | Настройка гарантированной доставки
:::warning{title=" Убедитесь, что эти шаги выполнены успешно:"}

 * [Настройка точек интеграции](https://developers.mindbox.ru/docs/add-ios-integration)
 * [Добавление SDK в приложение](https://developers.mindbox.ru/docs/add-sdk-react-native)
 * [Инициализация SDK](https://developers.mindbox.ru/docs/sdk-initialization-react-native)
:::

 :::info 
 [Пример реализации](https://github.com/mindbox-cloud/react-native-sdk/blob/develop/example/exampleApp/ios/AppDelegate.swift#L40)
:::

import Iosguaranteedeliverysetupxcode from '/src/_Iosguaranteedeliverysetupxcode.mdx';

<Iosguaranteedeliverysetupxcode />

## 2. Регистрация фоновых задач

Чтобы фоновые задачи работали, их нужно зарегистрировать в файле `AppDelegate.swift`.

```swift
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate {

    // ...

    func application(
        _ application: UIApplication,
        didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
    ) -> Bool {

        if #available(iOS 13.0, *) {
            Mindbox.shared.registerBGTasks()
        }

        UIApplication.shared.setMinimumBackgroundFetchInterval(
            UIApplication.backgroundFetchIntervalMinimum
        )

        return true
    }

    func application(
        _ application: UIApplication,
        didReceiveRemoteNotification userInfo: [AnyHashable: Any],
        fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void
    ) {
        Mindbox.shared.application(
            application,
            performFetchWithCompletionHandler: completionHandler
        )
    }
}
```
