[Coming soon] Configure background tasks
We use background tasks to send you a usage report when a user is not using your app at the moment. This allows us to ensure that usage tracking is delivered to our servers.
To send network requests with usage reports in the background, you must select the Background fetch checkbox in the Background modes capability group.
- Go to the Signing & Capabilities tab.
- Add Background modescapability.
- Select Background fetchmode.
- Select Background processingmode.
 
Add the following code to your UIApplicationDelegate class:
func application(
  _ application: UIApplication,
  handleEventsForBackgroundURLSession identifier: String,
  completionHandler: @escaping () -> Void
)
{
  if SetappManager.isSetappBackgroundSessionIdentifier(identifier) {
    SetappManager.shared.backgroundSessionCompletionHandler = completionHandler
  }
}Permitted background task identifiers
For iOS 13 and later, we also utilize background tasks. That means that you must allow Setapp to run background tasks with specific identifiers. To do that:
- Open your Info.plistfile.
- Add the Permitted background task scheduler identifiers(BGTaskSchedulerPermittedIdentifiers) key to the dictionary.
- Append com.setapp.usageReportto the key values array.

Updated 3 months ago
