I want to authenticate user on registration, I have a mobile number field in registration form. When user clicks on submit (Submit button is digits buttton ) he should receive the otp and redirected to the otp page, where he will enter the otp. I just want to skip the screen where user manually enters the mobile number.
DigitsAuthButton digitsButton = (DigitsAuthButton)
findViewById(R.id.auth_button);
digitsButton.setCallback(new AuthCallback() {
@Override
public void success(DigitsSession session, String phoneNumber) {
// TODO: associate the session userID with your user model
Toast.makeText(getApplicationContext(),
"Authenticationsuccessful for " + phoneNumber, Toast.LENGTH_LONG).show();
}
@Override
public void failure(DigitsException exception) {
Log.d("Digits", "Sign in with Digits failure", exception);
}
});
You can achieve this using following way. I always prefer this for my App Development so this give you some hint.