AuthyoService class
Singleton service to interact with Authyo APIs for sending and verifying OTPs.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearToken(
) → void -
Clears the current
clientIdandclientSecret. -
init(
{String? clientId, String? clientSecret, Duration? connectTimeout, Duration? receiveTimeout, bool? showVerificationDialog}) → void -
Initializes the plugin with your
clientIdandclientSecret. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
sendOtp(
{required BuildContext ctx, required String to, bool resendOTP = false, int? expiry, int? otpLength, AuthwayEnum? authWay, void onVerificationComplete(AuthyoResult authyoResult)?}) → Future< AuthyoResult> -
SEND OTP REQUEST
Triggers a sendOtp request to Authyo Servers using your
clientIdandclientSecret.toparam requires aphoneNumberoremailAddressThis request optionally acceptsexpiry(in seconds),otpLength(By Default 6),authWay(sms,whatsapp etc..). Returns an AuthyoResult containing either the an AuthyoResponseModel or anApiError.authWayan optional argument to specify the platform to send OTP such as SMS, Whatsapp, Voice call.onVerificationCompletecallback function to check whether OTP validation is successful or not. It should be ONLY used when plugin's default OTP verification dialog is used. -
toString(
) → String -
A string representation of this object.
inherited
-
verifyOtp(
{required String maskId, required String otp}) → Future< AuthyoResult> -
VERIFY OTP
Triggers a verifyOtp request to Authyo Servers using your
clientIdandclientSecret.maskIdparam requires a valid maskId received from sendOtp response, in case of success.otpparam requires the OTP you have received via your desiredauthWayReturns an AuthyoResult containing either the an AuthyoResponseModel or anApiError.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- instance → AuthyoService
-
The single instance of AuthyoService.
final