identity-samples
identity-samples copied to clipboard
Play Services Hint Request cannot display phone numbers
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!
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.
Comment by eygraber
Tuesday Jul 17, 2018 at 03:39 GMT
I have the same issue :frowning_face:
@Kishiko where do you set the phone number on the device?
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.
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. :(
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
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."
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)
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)
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
Comment by iam1492
Thursday Feb 07, 2019 at 06:23 GMT
Need help :) Please Vote to this issue: https://issuetracker.google.com/issues/123654951
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.
Doesn't work on Galaxy S10+ with Android 10
Doesn't work on Mi 4
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?
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
Doesn't works on Redmi 9i android 10. Showing the same weird animation and pop up disappears..Has anyone found the sol?
Same issue with Xiaomi Redmi 5 plus Did anyone find the ways?
+1
Any update here?
Same issue with emulator, 王德发, any body solved this problem
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
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.
It is work for me, when a added phone number to my SIM-card at device settings. Realme 8 pro
Sorry could you give more detail about how to add phone number to the sim card?
Any Update here?