SAPcpmsUserBlockedObserver
open class SAPcpmsUserBlockedObserver : SAPURLSessionObserving
Use this observer to detect user blocked errors from SAPcpms.
When a blocked response is detected, the provided handler is called with the specific blocking case - see SAPcpmsUserBlockedError
for more information.
The observer is in silent mode after this detection and will remain in this mode until a non-blocking response is detected. The observer will not call the provided handler while in silent mode.
All requests that are detected as blocking ones will result in the appropriate SAPcpmsUserBlockedError
error.
-
HTTP status code used on SAPcpms to signal the blocked user.
Declaration
Swift
public let blockedHTTPStatusCode: Int
-
HTTP header name used on SAPcpms to signal the blocked user.
Declaration
Swift
public let blockedHTTPHeaderName: String
-
The handler to invoke when a blocked user is detected.
Declaration
Swift
public let userBlockedHandler: (SAPcpmsUserBlockedError) -> Void
-
Instantiates the observer. This observer can be used to detect a blocked user on SAPcpms. When a blocked user is detected, the provided handler is invoked.
Declaration
Swift
public init(userBlockedHandler: @escaping (SAPcpmsUserBlockedError) -> Void)
Parameters
userBlockedHandler
the block to invoke when a blocked user is detected
-
Declaration
Swift
open func sapURLSession(_ session: SAPURLSession, dataTask: SAPURLSessionTask, didReceive response: URLResponse, completionHandler: @escaping (SAPURLSession.ResponseDisposition) -> Void)
-
Declaration
Swift
open func sapURLSession(_ session: SAPURLSession, downloadTask: SAPURLSessionTask, didFinishDownloadingTo location: URL, completionHandler: @escaping (SAPURLSession.DidCompleteDisposition) -> Void)
-
Declaration
Swift
open func sapURLSession(_ session: SAPURLSession, task: SAPURLSessionTask, didCompleteWithError error: Error?, completionHandler: @escaping (SAPURLSession.DidCompleteDisposition) -> Void)
-
Undocumented
Declaration
Swift
public func copy() -> Any?