question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Play Services Hint Request cannot display phone numbers

See original GitHub issue

Issue by 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)

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

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!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:24

github_iconTop GitHub Comments

5reactions
0x384c0commented, Aug 7, 2020

At least how do we know that phone numbers could not be found on device before calling startIntentSenderForResult, so we could avoid that animation with empty box?

3reactions
andzejswcommented, Feb 7, 2020

Doesn’t work on Galaxy S10+ with Android 10

Read more comments on GitHub >

github_iconTop Results From Across the Web

Play Services Hint Request cannot display phone numbers ...
To display hints only by phone try to use only setPhoneNumberIdentifierSupported(true) : HintRequest hintRequest = new HintRequest.Builder() .
Read more >
Play Services Hint Request cannot display phone numbers #27
When I trying to retrieve phone number with Credentials api some device failed to showing phone number picker dialog and just showing empty ......
Read more >
Phone Number Hint | Credential Verification
The Phone Number Hint API, a library powered by Google Play services, provides a frictionless way to show a user's (SIM-based) phone numbers...
Read more >
Using CredentialsApi to retrieve phone number. - Issue Tracker
When I trying to retrieve phone number with Credentials api some device failed ... /play-services-hint-request-cannot-display-phone-numbers-when-requested ”.
Read more >
Change the phone number on your account & how it's used
You can add, update, or remove phone numbers on your Google Account. Phone numbers are used for different reasons, and you have controls...
Read more >

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found