Created
October 23, 2014 07:41
-
-
Save rallat/849a68520ca10d913aeb to your computer and use it in GitHub Desktop.
Digits with custom button
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final AuthCallback authCallback = new AuthCallback() { | |
@Override | |
public void success(DigitsSession digitsSession, String s) { | |
//Success !! | |
} | |
@Override | |
public void failure(DigitsException e) { | |
//sad :( | |
} | |
}; | |
button.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View view) { | |
Digits.authenticate(authCallback); | |
} | |
}); |
AuthConfig.Builder builder = new AuthConfig.Builder();
builder.withAuthCallBack(new AuthCallback() {
@Override
public void success(DigitsSession session, String phoneNumber) {
Toast.makeText(getApplicationContext(), "Authentication successful for "
+ phoneNumber, Toast.LENGTH_LONG).show();
// Do something
}
@Override
public void failure(DigitsException error) {
// Do something
}
});
AuthConfig authConfig = builder.build();
Digits.authenticate(authConfig);
It does not work
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there isn't a way to trigger it automatacly w ithout having to click