public class OtpManager
extends java.lang.Object
implements android.arch.lifecycle.LifecycleObserver
OtpManager class collects all of the APIs related to one-time passwords (OTP). This
includes processes such as requesting and verifying an OTP. All of these methods will be executed
on a background thread and return the result on the main thread. To receive the result, you are
expected to pass a corresponding CompleteCallback or SingleCallback.| Constructor and Description |
|---|
OtpManager(android.support.v7.app.AppCompatActivity appCompatActivity)
Constructor for an
OtpManager object with the lifecycle set. |
OtpManager(android.support.v4.app.Fragment fragment)
Constructor for an
OtpManager object with the lifecycle set. |
OtpManager(android.arch.lifecycle.Lifecycle lifecycle)
Constructor for an
OtpManager object with the lifecycle set. |
| Modifier and Type | Method and Description |
|---|---|
void |
requestOtp(OtpRequestParam otpRequestParam,
CompleteCallback callback)
Returns a
CompleteCallback after requesting a one-time password (OTP) |
void |
verifyOtp(OtpVerifyParam otpVerifyParam,
SingleCallback<java.lang.String> callback)
Returns a
CompleteCallback after verifying the one-time password (OTP). |
public OtpManager(android.arch.lifecycle.Lifecycle lifecycle)
OtpManager object with the lifecycle set.lifecycle - See Lifecyclepublic OtpManager(android.support.v7.app.AppCompatActivity appCompatActivity)
OtpManager object with the lifecycle set.appCompatActivity - See AppCompatActivitypublic OtpManager(android.support.v4.app.Fragment fragment)
OtpManager object with the lifecycle set.fragment - See Fragmentpublic void requestOtp(OtpRequestParam otpRequestParam, CompleteCallback callback)
CompleteCallback after requesting a one-time password (OTP)otpRequestParam - otp param to request otp. See OtpRequestParamcallback - the callback to receive the result of requesting an OTPpublic void verifyOtp(OtpVerifyParam otpVerifyParam, SingleCallback<java.lang.String> callback)
CompleteCallback after verifying the one-time password (OTP).otpVerifyParam - the otpVerifyParam used to verify OTP. See OtpVerifyParamcallback - the callback to receive the result of verifying the OTP