All SMS OTP SDK methods require you to initiate an action first first.
Challenge
Start a WhatsApp OTP challenge by sending the user a WhatsApp message containing an OTP code.
await authsignal.whatsapp.challenge()
Response
An unstructured error description present if the SDK call encountered an error.
Verify
Finish re-authenticating a WhatsApp OTP authenticator by verifying the code submitted by the user.
let response = await authsignal.whatsapp.verify(code: "123456")
let isVerified = response.isVerified
Parameters
The OTP code inputted by the user.
Response
response
AuthsignalResponse<VerifyResponse>
An unstructured error description present if the SDK call encountered an error.
True if the verification was successful.
A structured code present if the verification failed due to user error. Possible values are:
CODE_INVALID_OR_EXPIRED or MAX_ATTEMPTS_EXCEEDED.