Smart Lock sign-in hint setPhoneNumberIdentifierSu

2019-05-31 07:12发布

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条回答
别忘想泡老子
2楼-- · 2019-05-31 07:17

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

查看更多
登录 后发表回答