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