Yahya Ayash Luqman Yahya Ayash Luqman - 1 year ago 122
Android Question

Digits android authcallback not called on success/failure otp verification

I am creating a digitsauthconfig like this:

private DigitsAuthConfig createDigitsAuthConfig() {
return new DigitsAuthConfig.Builder()

Where authcallback is returned by:

private AuthCallback createAuthCallback() {
return new AuthCallback() {
public void success(DigitsSession session, String phoneNumber) {

public void failure(DigitsException exception) {

I initiate the process using a button with event listener:

digitsButton.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {

The problem is, once my phone number is verified, it goes back to the activity where the button is displayed and does nothing. Technically, the authcallback is never called, doesn't matter successful or not. But if I click the button again, the authcallback is called without repeating the verification step. So right now I am required to click the button twice.
What is the way around it?

Answer Source

Finally i got solution for that issue, May it will help you too also.

You need to remove the ActiveSession, before calling the setCallback(authCallback) like mentioned as below.It will remove the existing session(if you already entered your phone number and got an OTP) from digits. This session will will not allows you to make another session to generate an OTP. So, we have to remove it. And it will work if there is no any previous sessions.

    DigitsAuthButton digitsButton = (DigitsAuthButton) findViewById(R.id.auth_button);
    digitsButton.setCallback(((WyzConnectApp) getApplication()).getAuthCallback());
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download