OutOfBandOperation

public protocol OutOfBandOperation : HttpOperation

The operation managing an OutOfBandPayload. An OutOfBandPayload can be provided through different means: a push notification, a QR code or an application link. This operation will process the payload, decrypt it if needed and send it to the server. If the payload is successfully handled by the server, then the SDK will identify whether the operation associated with the payload is a registration or an authentication. Depending on that the onRegistration(_:) or the onAuthentication(_:) will be invoked.

Usage example:

client.operations.outOfBandOperation
    .payload(payload)
    .onRegistration { oobRegistration in
        ...
    }
    .onAuthentication { oobAuthentication in
        ...
    }
    .onError { error in
        ...
    }
    .execute()
  • Specifies the out-of-band payload to be handled.

    Important

    Providing the out-of-band payload is required.

    Declaration

    Swift

    @discardableResult
    func payload(_ payload: OutOfBandPayload) -> OutOfBandOperation

    Parameters

    payload

    Return Value

    the OutOfBandOperation builder.

  • Specifies the block that will handle the OutOfBandRegistration object associated with the OutOfBandPayload.

    Important

    Providing at least one of the onRegistration or onAuthentication block is required.

    Declaration

    Swift

    @discardableResult
    func onRegistration(_ onRegistration: @escaping (OutOfBandRegistration) -> ()) -> OutOfBandOperation

    Parameters

    onRegistration

    the block to execute in case of registration.

    Return Value

    the OutOfBandOperation builder.

  • Specifies the block that will handle the OutOfBandAuthentication object associated with the OutOfBandPayload.

    Important

    Providing at least one of the onRegistration or onAuthentication block is required.

    Declaration

    Swift

    @discardableResult
    func onAuthentication(_ onAuthentication: @escaping (OutOfBandAuthentication) -> ()) -> OutOfBandOperation

    Parameters

    onAuthentication

    the block to execute in case of authentication.

    Return Value

    the OutOfBandOperation builder.

  • Specifies the block to execute if there was an error handling the OutOfBandPayload: The payload could not be decrypted, the server could not be reached, the server returned an error, etc. This object will be invoked in the DispatchQueue.main thread.

    Important

    Providing the onError block is required.

    Declaration

    Swift

    @discardableResult
    func onError(_ onError: @escaping (OutOfBandOperationError) -> ()) -> OutOfBandOperation

    Parameters

    onError

    the block to execute on failed operation, receives an OutOfBandOperationError.

    Return Value

    the OutOfBandOperation builder.