|class||Cocoa Networking||MBS MacFrameworks Plugin||20.2||✅ Yes||❌ No||❌ No||✅ Yes||All|
An NSURLSessionConfigurationMBS object defines the behavior and policies to use when uploading and downloading data using an NSURLSessionMBS object. When uploading or downloading data, creating a configuration object is always the first step you must take. You use this object to configure the timeout values, caching policies, connection requirements, and other types of information that you intend to use with your NSURLSessionMBS object.
It is important to configure your NSURLSessionConfigurationMBS object appropriately before using it to initialize a session object. Session objects make a copy of the configuration settings you provide and use those settings to configure the session. Once configured, the session object ignores any changes you make to the NSURLSessionConfigurationMBS object. If you need to modify your transfer policies, you must update the session configuration object and use it to create a new NSURLSessionMBS object.
In some cases, the policies defined in this configuration may be overridden by policies specified by an NSURLRequestMBS object provided for a task. Any policy specified on the request object is respected unless the session’s policy is more restrictive. For example, if the session configuration specifies that cellular networking should not be allowed, the NSURLRequestMBS object cannot request cellular networking.
For more information about using configuration objects to create sessions, see NSURLSessionMBS class.
Types of Session Configurations
The behavior and capabilities of a URL session are largely determined by the kind of configuration used to create the session.
The singleton shared session (which has no configuration object) is for basic requests. It’s not as customizable as sessions that you create, but it serves as a good starting point if you have very limited requirements. You access this session by calling the shared class method. See that method’s discussion for more information about its limitations.
Default sessions behave much like the shared session (unless you customize them further), but let you obtain data incrementally using a delegate. You can create a default session configuration by calling the default method on the URLSessionConfiguration class.
Ephemeral sessions are similar to default sessions, but they don’t write caches, cookies, or credentials to disk. You can create an ephemeral session configuration by calling the ephemeral method on the URLSessionConfiguration class.
Background sessions let you perform uploads and downloads of content in the background while your app isn’t running. You can create a background session configuration by calling the backgroundSessionConfiguration(_:) method on the URLSessionConfiguration class.
- 22 properties
- property allowsCellularAccess as Boolean
- property allowsConstrainedNetworkAccess as Boolean
- property allowsExpensiveNetworkAccess as Boolean
- property connectionProxyDictionary as Dictionary
- property discretionary as Boolean
- property Handle as Integer
- property HTTPAdditionalHeaders as Dictionary
- property HTTPCookieAcceptPolicy as Integer
- property HTTPCookieStorage as NSHTTPCookieStorageMBS
- property HTTPMaximumConnectionsPerHost as Integer
- property HTTPShouldSetCookies as Boolean
- property HTTPShouldUsePipelining as Boolean
- property identifier as String
- property NetworkServiceType as Integer
- property RequestCachePolicy as Integer
- property sharedContainerIdentifier as String
- property shouldUseExtendedBackgroundIdleMode as Boolean
- property timeoutIntervalForRequest as Double
- property timeoutIntervalForResource as Double
- property URLCache as NSURLCacheMBS
- property URLCredentialStorage as NSURLCredentialStorageMBS
- property waitsForConnectivity as Boolean
- 2 methods
- 4 shared methods
- 23 constants
The URL load should be loaded only from the originating source.
Ignore local cache data, and instruct proxies and other intermediates to disregard their caches so far as the protocol allows.
The URL load should be loaded only from the originating source.
Use cache data if the origin source can validate it; otherwise, load from the origin.
Use existing cache data, regardless or age or expiration date, and fail if no cached data is available.
Use existing cache data, regardless or age or expiration date, loading from originating source only if there is no cached data.
Use the caching logic defined in the protocol implementation, if any, for a particular URL load request.
Cookie Accept Policy
Accept all cookies. This is the default cookie accept policy.
Reject all cookies.
Accept cookies only from the main document domain.
Multipath TCP Modes
A service that aggregates the capacities of other Multipath options in an attempt to increase throughput and minimize latency.
A Multipath TCP service that provides seamless handover between Wi-Fi and cellular in order to preserve the connection.
A service whereby Multipath TCP attempts to use the lowest-latency interface.
The default service type indicating that Multipath TCP should not be used.
Network Service Types
A service type for streaming audio/video data.
A service type for background traffic.
You should specify this type if your app is performing a download that was not requested by the user—for example, prefetching content so that it will be available when the user chooses to view it.
A service type for call signaling.
Use this service type with network traffic that establishes, maintains, or tears down a VoIP call. Use the NSURLNetworkServiceTypeVoIP type for the actual media of a call.
A service type for standard network traffic.
A service type for responsive (time-sensitive) audio/video data.
A service type for data that the user is actively waiting for.
This service type’s priority is higher than NSURLNetworkServiceTypeDefault. Use this service type for interactive situations where the user is anticipating a quick response, like instant messaging or completing a purchase.
A service type for video traffic.
A service type for voice traffic.
A service type for VoIP traffic.
With the VoIP service type, the kernel continues to listen for incoming traffic while your app is in the background, then wakes up your app whenever new data arrives. This should be used only for connections that are used to communicate with a VoIP service.
This class has no sub classes.
Some methods using this class:
- NSURLSessionMBS.Constructor(configuration as NSURLSessionConfigurationMBS)
Some properties using for this class:
- NSURLSessionMBS.configuration as NSURLSessionConfigurationMBS
Some examples using this class:
The items on this page are in the following plugins: MBS MacFrameworks Plugin.
MBS Xojo PDF Plugins