问题
I am trying to get user phone number with a HintRequest
PendingIntent intent = Auth.CredentialsApi.getHintPickerIntent(
googleApiClient, new HintRequest.Builder()
.setPhoneNumberIdentifierSupported(true)
.setEmailAddressIdentifierSupported(false)
.build());
try {
startIntentSenderForResult(intent.getIntentSender(),
REQUEST_CODE_RESOLVE_PHONE, null, 0, 0, 0);
} catch (IntentSender.SendIntentException e) {
e.printStackTrace();
}
But getting no results and Activity.RESULT_CANCELED.
The nubmer is visible in Settings -> About -> Status -> SIM status and can be received through TelephonyManager, but I would like to get it without requesting the phone permission.
回答1:
Turned out it was a sim card problem, didn't work with EE sim
来源:https://stackoverflow.com/questions/45730158/smart-lock-sign-in-hint-setphonenumberidentifiersupported-not-working