Instance Property

networkServiceType

The type of network service for all tasks within sessions based on this configuration.

Declaration

@property NSURLRequestNetworkServiceType networkServiceType;

Discussion

The network service type provides a hint to the operating system about what the underlying traffic is used for. This hint enhances the system's ability to prioritize traffic, determine how quickly it needs to wake up the cellular or Wi-Fi radio, and so on. By providing accurate information, you improve the ability of the system to optimally balance battery life, performance, and other considerations.

For example, specify the NSURLNetworkServiceTypeBackground type if your app is performing a download that wasn’t requested by the user, like prefetching content so that it’s available when the user chooses to view it.

This setting can also affect the Wi-Fi Quality of Service (QoS) Priority.

The default value is NSURLNetworkServiceTypeDefault.

See Also

Setting General Properties

identifier

The background session identifier of the configuration object.

HTTPAdditionalHeaders

A dictionary of additional headers to send with requests.

allowsCellularAccess

A Boolean value that determines whether connections should be made over a cellular network.

timeoutIntervalForRequest

The timeout interval to use when waiting for additional data.

timeoutIntervalForResource

The maximum amount of time that a resource request should be allowed to take.

sharedContainerIdentifier

The identifier for the shared container into which files in background URL sessions should be downloaded.

waitsForConnectivity

A Boolean value that indicates whether the session should wait for connectivity to become available, or fail immediately.