Created
March 9, 2019 08:50
-
-
Save pratheepchowdhary/d0a7c350669c9732ca33be3f4ac119d2 to your computer and use it in GitHub Desktop.
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
// Construct a request for phone numbers and show the picker | |
private void requestHint() { | |
HintRequest hintRequest = new HintRequest.Builder() | |
.setPhoneNumberIdentifierSupported(true) | |
.build(); | |
PendingIntent intent = Auth.CredentialsApi.getHintPickerIntent( | |
apiClient, hintRequest); | |
startIntentSenderForResult(intent.getIntentSender(), | |
RESOLVE_HINT, null, 0, 0, 0); | |
} | |
// Obtain the phone number from the result | |
@Override | |
public void onActivityResult(int requestCode, int resultCode, Intent data) { | |
super.onActivityResult(requestCode, resultCode, data); | |
if (requestCode == RESOLVE_HINT) { | |
if (resultCode == RESULT_OK) { | |
Credential credential = data.getParcelableExtra(Credential.EXTRA_KEY); | |
// credential.getId(); <-- will need to process phone number string | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment