Creates a session configuration object that allows HTTP and HTTPS uploads or downloads to be performed in the background.
- iOS 8.0+
- macOS 10.10+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
The unique identifier for the configuration object. This parameter must not be
nilor an empty string.
A configuration object that causes the system to perform upload and download tasks in a separate process.
Use this method to initialize a configuration object suitable for transferring data files while the app runs in the background. A session configured with this object hands control of the transfers over to the system, which handles the transfers in a separate process. In iOS, this configuration makes it possible for transfers to continue even when the app itself is suspended or terminated.
If an iOS app is terminated by the system and relaunched, the app can use the same
identifier to create a new configuration object and session and to retrieve the status of transfers that were in progress at the time of termination. This behavior applies only for normal termination of the app by the system. If the user terminates the app from the multitasking screen, the system cancels all of the session’s background transfers. In addition, the system does not automatically relaunch apps that were force quit by the user. The user must explicitly relaunch the app before transfers can begin again.
You can configure an background session to schedule transfers at the discretion of the system for optimal performance using the
is property. When transferring large amounts of data, you are encouraged to set the value of this property to
true. For an example of using the background configuration, see Downloading Files in the Background.