dunkah0lic dunkah0lic - 1 month ago 14
Android Question

Smart Lock sign-in hint setPhoneNumberIdentifierSupported not working

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.

Answer Source

Turned out it was a sim card problem, didn't work with EE sim