Keyless Delegate Protocol
The KeylessDelegateProtocol asynchronously informs the delegate of enrollment completion/failure and progress.
Declaration public static let shared: Keyless

enrollmentDidProgress(progress:)

Reports the updated enrollment progress. The callee may display a progress indicator at this time. Implementation of this method is optional.
Default implementation
Declaration func enrollmentDidProgress(progress: Float)
Paramaters
progress
A floating point value between 0 and 1 (included) which indicates the current enrollment progress.

enrollmentDidStart()

This method indicates that the view controller used for enrollment has been dismissed. The callee may display an interface that indicates processing (e.g. a spinner) at this time. Implementation of this method is optional.
Default implementation
Declaration func enrollmentDidStart()

enrollmentDidFinish(keylessID:enrollmentResponse:error:)

Reports enrollment completion.
Declaration func enrollmentDidFinish(keylessID: String?, enrollmentResponse: String?, error: KeylessError?)
Paramaters
keylessID
A string that uniquely identifies the user. If the Keyless class is operating in custom token mode, parameter keylessID is not set.
enrollmentResponse
A string that represents the response to the random challenge set as parameter of Keyless.enroll(...), if any.
error
If not nil, it indicates enrollment failure, and reports the reason.

authenticationDidStart()

This method indicates that the view controller used for authentication has been dismissed. The callee may display an interface that indicates processing (e.g. a spinner) at this time. Implementation of this method is optional.
Default implementation
Declaration func authenticationDidStart()

authenticationDidFinish(token:error:)

Reports the completion of authentication and returns the authentication token.
Declaration func authenticationDidFinish(token: String?, error: KeylessError?)
Paramaters
token
In legacy mode, the token is a cryptographic claim which corresponds to the message parameter of Keyless.getAuthenticationToken(...). In custom token mode, token is the custom authentication token set by enrollCustomToken.
error
If not nil, it indicates authentication failure, and reports the reason.

deEnrollmentDidStart()

This method indicates that the view controller used for de-enrollment has been dismissed. The callee may display an interface that indicates processing (e.g. a spinner) at this time. Implementation of this method is optional.
Default implementation
Declaration func deEnrollmentDidStart()

deEnrollmentDidFinish(deEnrollmentResponse:error:)

Reports de-enrollment completion.
Declaration func deEnrollmentDidFinish(deEnrollmentResponse: String?, error: KeylessError?)
Paramaters
deEnrollmentResponse
A string that represents the response to the random challenge set as parameter of Keyless.deEnroll(...), if any.
error
If not nil, it indicates authentication failure, and reports the reason.