Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Play Services Hint Request cannot display phone numbers #6

Open
codingjeremy opened this issue Sep 10, 2019 · 27 comments
Open

Play Services Hint Request cannot display phone numbers #6

codingjeremy opened this issue Sep 10, 2019 · 27 comments
Labels
migrated googlesamples Migrated from old googlesamples repos

Comments

@codingjeremy
Copy link
Contributor

Issue by iam1492
Wednesday Apr 11, 2018 at 15:19 GMT
Originally opened as googlearchive/android-credentials#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!

@codingjeremy
Copy link
Contributor Author

Comment by Kishiko
Thursday Jul 05, 2018 at 11:55 GMT


I also had that same issue "showing empty dialog and disappearing quickly with sliding animation." I had overcome it by setting at least one phone number on my device, in the parameters.

@codingjeremy
Copy link
Contributor Author

Comment by eygraber
Tuesday Jul 17, 2018 at 03:39 GMT


I have the same issue ☹️

@Kishiko where do you set the phone number on the device?

@codingjeremy
Copy link
Contributor Author

Comment by dalmendray
Wednesday Oct 24, 2018 at 22:28 GMT


Has anyone found a solution for this? I want to know before trying to show the dialog that there's no phone number to show. It looks weird to the user the animation of the dialog showing and disappearing instantly because no phone numbers were found in the device.

@codingjeremy
Copy link
Contributor Author

Comment by iam1492
Thursday Oct 25, 2018 at 02:18 GMT


I tried to open the issue from Android Issue Tracker.
https://issuetracker.google.com/issues/77884951
But they said this is OEM issue that their pixel or nexus phone working well.
They made buggy api and do not trying to correct it.
Most people use non google device. :(

@codingjeremy
Copy link
Contributor Author

Comment by mesibo
Friday Oct 26, 2018 at 14:16 GMT


We are facing the same issue, works on some devices, not on others.

For example,

  • Works fine on Asus phone running Oreo 8.1.0
  • Not working on LG G6 running Oreo 8.0.0 - error is ACTIVITY_RESULT_NO_HINTS_AVAILABLE

@codingjeremy
Copy link
Contributor Author

Comment by greenpeas
Monday Nov 19, 2018 at 07:46 GMT


I also had that same issue "showing empty dialog and disappearing quickly with sliding animation."

@codingjeremy
Copy link
Contributor Author

Comment by behelit
Monday Jan 21, 2019 at 00:56 GMT


Works on Galaxy Note 8 (8.0.0)
Does not work on Sony Z2 (6.0.1)
Does NOT work on Pixel -> LOL (9)

@codingjeremy
Copy link
Contributor Author

Comment by MadaoChan
Monday Jan 21, 2019 at 02:34 GMT


Not work on

  • One Plus 5T (H2OS, 8.1.0)
  • Samsung SM-G570Y(8.0.0)
  • Samsung S7 edge(8.0.0)

@codingjeremy
Copy link
Contributor Author

Comment by foxware00
Tuesday Jan 29, 2019 at 14:36 GMT


I have two Pixel 3XL both running Pie (9.0.0) and it works perfectly on one, and fails every time on the other

@codingjeremy
Copy link
Contributor Author

Comment by iam1492
Thursday Feb 07, 2019 at 06:23 GMT


Need help :)
Please Vote to this issue:
https://issuetracker.google.com/issues/123654951

@codingjeremy
Copy link
Contributor Author

Comment by otopba
Monday Aug 26, 2019 at 09:20 GMT


Same problems =/

@codingjeremy
Copy link
Contributor Author

Comment by jiurchuk
Monday Sep 09, 2019 at 20:43 GMT


Happening also in Google Pixel XL running Android 10 and having Phone Number associated in my Google Account.

@codingjeremy codingjeremy added the migrated googlesamples Migrated from old googlesamples repos label Sep 18, 2019
@andzejsw
Copy link

andzejsw commented Feb 7, 2020

Doesn't work on Galaxy S10+ with Android 10

@hardikamal
Copy link

hardikamal commented Jul 30, 2020

Doesn't work on Mi 4

@0x384c0
Copy link

0x384c0 commented 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?

@ridsync
Copy link

ridsync commented Nov 10, 2020

Doesn't work on Galaxy Note10+ with Android 10
resultcode is ACTIVITY_RESULT_NO_HINTS_AVAILABLE
i want to get device's Phone number . plz... LOL

@introidx
Copy link

Doesn't works on Redmi 9i android 10. Showing the same weird animation and pop up disappears..Has anyone found the sol?

@AzizjonDekhkanov
Copy link

Same issue with Xiaomi Redmi 5 plus
Did anyone find the ways?

@nolimitdev
Copy link

+1

@hardikamal
Copy link

Any update here?

@OvenCroc
Copy link

Same issue with emulator, 王德发, any body solved this problem

@krunalpatel3
Copy link

this the project working in Android 11 emulator https://github.com/introidx/phone-Selecter

but not working in device's:

Mi note
Vivo

the list of number dialog is not opening.

there is same issue in flipkart App: https://play.google.com/store/apps/details?id=com.flipkart.android&hl=en_IN&gl=US

@nolimitdev
Copy link

nolimitdev commented Sep 22, 2021

My finding is that this feature is depended in SIM card of mobile operator. If mobile operator does not store cell phone number on the SIM this feature is not working - dialog which should show number appears and quickly disappear. If number is stored on SIM card this feature works well, but strange is that number is without international preset e.g. +4.. or 004.. so it is still not usable for me without country code. In my country there are 4 mobile operators and I tested SIM card each of them... and 2 of them stores number on the SIM card and other 2 does not store. Whether your operator stores number on the SIM you can easily test by android app SIM Card Info https://play.google.com/store/apps/details?id=me.harrygonzalez.simcardinfo Strange is that google does not explain this, several issues are reported at https://issuetracker.google.com/ but no mention from google that feature is dependent on SIM card of mobile operator.

@Alexandrsneg
Copy link

It is work for me, when a added phone number to my SIM-card at device settings.
Realme 8 pro

@antoniodemarco85
Copy link

Sorry could you give more detail about how to add phone number to the sim card?

@nolimitdev
Copy link

Screenshot_20230915-212253_1_1

@Satish94922
Copy link

Any Update here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
migrated googlesamples Migrated from old googlesamples repos
Projects
None yet
Development

No branches or pull requests