android / android/identity-samples

Play Services Hint Request cannot display phone numbers

Open
#6 27 comments 0 reactions 0 assignees View on GitHub
migrated googlesamples
Dominant language
Kotlin
Stars
515
Forks
283
Avg merge
9h 37m
Merged PRs (30d)
2

Description

**Issue by [iam1492](https://github.com/iam1492)**
_Wednesday Apr 11, 2018 at 15:19 GMT_
_Originally opened as https://github.com/googlesamples/android-credentials/issues/27_

----

When I trying to retrieve phone number with Credentials api some device failed to showing phone number picker dialog and just showing empty dialog and the dialog disappear quickly with sliding animation.

Below is my code sample. (And I also tried with google sample)

```kotlin
val hintRequest = HintRequest.Builder()
.setPhoneNumberIdentifierSupported(true)
.setEmailAddressIdentifierSupported(false)
.build()
val options = CredentialsOptions.Builder()
.forceEnableSaveDialog()
.build()
val pendingIntent = Credentials.getClient(this, options).getHintPickerIntent(hintRequest)
startIntentSenderForResult(pendingIntent.intentSender, PHONE_REQUEST, null, 0, 0, 0)
```
and OnActivityResult

```kotlin
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)

if (requestCode == PHONE_REQUEST) {
if (data != null) {
val credential: Credential? = data.getParcelableExtra(Credential.EXTRA_KEY)
val phoneNumber = credential?.id
// Some of our device fail to get phoneNumber here.
}
}
}

```

In this case, empty popup showed up and disappear quickly with weird animation.
And no value returned in onActivityResult callback.
Even if it fails, popup will not appear and developer should know before popup is showing.
If developer can know this will happen earlier, developer can do alternative way. For example, make user type their phone number manually.
This issue is not related with Android version. Brand new phone or old phone have same issue and might be related with SIM card.(I guess..)
I saw this bug on Samsung galaxy S7, S9.(one of S9 phone we have works fine but the other not)

Thanks!

Contributor guide

Open the contributing guide

Research direction

Start with the HintRequest.Builder and Credentials.getClient(...).getHintPickerIntent flow shown in the issue, then inspect the onActivityResult callback and the referenced Google sample. Determine whether the empty picker and missing Credential can be detected before display; done requires a reproducible failure condition and a documented or implemented fallback path.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
authentication, mobile
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.