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()
See
OutOfBandPayload
-
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
the
OutOfBandPayload
.Return Value
the
OutOfBandOperation
builder. -
Specifies the block that will handle the
OutOfBandRegistration
object associated with theOutOfBandPayload
.Important
Providing at least one of theonRegistration
oronAuthentication
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 theOutOfBandPayload
.Important
Providing at least one of theonRegistration
oronAuthentication
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 theDispatchQueue.main
thread.Important
Providing theonError
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.