Guaranteed Delivery Setup
Make sure these steps are completed successfully:
Xcode settings
Background tasks are required for the guaranteed delivery mechanism to allow the SDK to send events while the app is in the background.
To enable them, add the following variables to Info.plist:
Required background modes:- App downloads content from the network;
- App processes data in the background;
- App downloads content in response to push notifications;
Permitted background task scheduler identifiers:cloud.Mindbox.$(PRODUCT_BUNDLE_IDENTIFIER).GDAppRefresh;cloud.Mindbox.$(PRODUCT_BUNDLE_IDENTIFIER).GDAppProcessing;cloud.Mindbox.$(PRODUCT_BUNDLE_IDENTIFIER).DBCleanAppProcessing.

Background task registration
If your AppDelegate inherits from MindboxFlutterAppDelegate, no additional changes are required to enable guaranteed delivery.
If youāre not using MindboxFlutterAppDelegate, youāll need to complete the full setup and implement all required methods manually.
Example
For background tasks to work, you need to register them in AppDelegate.swift file.
import UIKit
import Flutter
import Mindbox
import MindboxNotifications
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
// Registering Background Tasks (iOS 13+)
if #available(iOS 13.0, *) {
Mindbox.shared.registerBGTasks()
} else {
UIApplication.shared.setMinimumBackgroundFetchInterval(
UIApplication.backgroundFetchIntervalMinimum
)
}
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
// Registering Background Tasks (iOS < 13)
override func application(
_ application: UIApplication,
performFetchWithCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void
) {
Mindbox.shared.application(
application,
performFetchWithCompletionHandler: completionHandler
)
}
}Updated 7 months ago

