SFNetwork Class Reference
| Inherits from | NSObject |
|---|---|
| Declared in | SFNetwork.h |
metricsCollectedAction
The block to execute to execeute when metrics are collected on URL session task, if provided.
@property (class, nonatomic, copy, nullable) SFSDKMetricsCollectedBlock metricsCollectedActionDeclared In
SFNetwork.h
+ sharedEphemeralInstance
Returns an instance of this class with the default ephemeral session configuration.
+ (nonnull instancetype)sharedEphemeralInstanceReturn Value
Instance of this class.
Declared In
SFNetwork.h
+ sharedBackgroundInstance
Returns an instance of this class with the default background session configuration.
+ (nonnull instancetype)sharedBackgroundInstanceReturn Value
Instance of this class.
Declared In
SFNetwork.h
+ sharedEphemeralInstanceWithIdentifier:
Returns instance of this class for the given identifier with the default ephemeral session configuration.
+ (nonnull instancetype)sharedEphemeralInstanceWithIdentifier:(nonnull NSString *)identifierReturn Value
Instance of this class.
Declared In
SFNetwork.h
+ sharedBackgroundInstanceWithIdentifier:
Returns instance of this class for the given identifier with the default background session configuration.
+ (nonnull instancetype)sharedBackgroundInstanceWithIdentifier:(nonnull NSString *)identifierReturn Value
Instance of this class.
Declared In
SFNetwork.h
+ sharedInstanceWithIdentifier:sessionConfiguration:
Returns an instance of this class with the given session configuration.
+ (nonnull instancetype)sharedInstanceWithIdentifier:(nonnull NSString *)identifier sessionConfiguration:(nonnull NSURLSessionConfiguration *)sessionConfigurationParameters
identifier |
Identifier for the instance |
|---|---|
sessionConfiguration |
Configuration to use for the session. |
Return Value
Instance of this class.
Declared In
SFNetwork.h
– sendRequest:dataResponseBlock:
Sends a REST request and calls the appropriate completion block.
- (nonnull NSURLSessionDataTask *)sendRequest:(nonnull NSURLRequest *)urlRequest dataResponseBlock:(nullable SFDataResponseBlock)dataResponseBlockParameters
urlRequest |
NSURLRequest instance. |
|---|---|
dataResponseBlock |
Network response block. |
Return Value
NSURLSessionDataTask instance.
Declared In
SFNetwork.h
+ setSessionConfiguration:identifier:
Sets a session configuration to be used for network requests in Mobile SDK.
+ (void)setSessionConfiguration:(nonnull NSURLSessionConfiguration *)sessionConfig identifier:(nonnull NSString *)identifierParameters
sessionConfig |
Session configuration to be used. |
|---|---|
identifier |
Identifier for the instance to use this config. |
Declared In
SFNetwork.h
+ removeSharedEphemeralInstance
Removes shared instance for the default ephemeral identifier.
+ (void)removeSharedEphemeralInstanceDeclared In
SFNetwork.h
+ removeSharedBackgroundInstance
Removes shared instance for the default background identifier.
+ (void)removeSharedBackgroundInstanceDeclared In
SFNetwork.h
+ removeSharedInstanceForIdentifier:
Removes shared instance for given identifier.
+ (void)removeSharedInstanceForIdentifier:(nullable NSString *)identifierParameters
identifier |
Identifier for the session. |
|---|
Declared In
SFNetwork.h
+ removeAllSharedInstances
Removes all shared instances.
+ (void)removeAllSharedInstancesDeclared In
SFNetwork.h
+ sharedInstanceIdentifiers
Returns list of identifiers for all shared instances.
+ (nullable NSArray *)sharedInstanceIdentifiersReturn Value
Array of identifiers.
Declared In
SFNetwork.h
+ uniqueInstanceIdentifier
Generates a unique instance identifier.
+ (nonnull NSString *)uniqueInstanceIdentifierDeclared In
SFNetwork.h