Skip to content

Instantly share code, notes, and snippets.

@rallat
Created October 23, 2014 07:41
Show Gist options
  • Select an option

  • Save rallat/849a68520ca10d913aeb to your computer and use it in GitHub Desktop.

Select an option

Save rallat/849a68520ca10d913aeb to your computer and use it in GitHub Desktop.
Digits with custom button
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);
}
});
@streamride
Copy link
Copy Markdown

Now it's deprecated

@geolyth
Copy link
Copy Markdown

geolyth commented Feb 29, 2016

Which is the alternative?

@Arkanayan
Copy link
Copy Markdown

Use DigitsAuthConfig Builder.

@mohamedhajr
Copy link
Copy Markdown

mohamedhajr commented Jul 11, 2016

Is there isn't a way to trigger it automatacly w ithout having to click

@frapeti
Copy link
Copy Markdown

frapeti commented Nov 17, 2016

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);

@Idimma
Copy link
Copy Markdown

Idimma commented Mar 24, 2017

It does not work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment