5

I'm trying to implement Android One Tap Sign In and I'm unable to show this dialog here:

Password Save Dialog

I keep getting the msg: com.google.android.gms.common.api.ApiException: 16: Skipping password saving since the user is likely prompted with Android Autofill.

How can I fix this?

Code:

private fun saveCredentials(email: String, password: String) {
    val signInPassword = SignInPassword(email, password)
    val savePasswordRequest =
        SavePasswordRequest.builder().setSignInPassword(signInPassword).build()

    // Show the password save dialog
    Identity.getCredentialSavingClient(this)
        .savePassword(savePasswordRequest)
        .addOnFailureListener {e ->
            Log.d(TAG, Log.getStackTraceString(e))
        }
        .addOnSuccessListener { result ->
            startIntentSenderForResult(
                result.pendingIntent.intentSender,
                REQUEST_CODE_SAVE_CREDENTIALS,
                null,   // fillInIntent
                0,      // flagsMask
                0,      // flagsValues
                0,      // extraFlags
                null)   // options
        }
}

Documentation: https://developers.google.com/identity/one-tap/android/save-passwords

mco
  • 1,809
  • 15
  • 31
  • refer this https://stackoverflow.com/questions/47168873/google-smart-lock-dialog-is-not-appearing-in-android-o-devices – sasikumar Feb 09 '21 at 05:57

2 Answers2

-1

I also met---->: The save prompt is disabled for the current app. To restore, remove this app from the "Never save" list in the Smart Lock for Passwords settings for all accounts on this device.

Dawish
  • 1
-2

I found out that the save password dialog from One Tap Sign In will show only if you turn OFF the autofill service on your phone. You can do this by going to Settings > Languages & input > Advanced > Autofill Service.

If autofill is ON you will get the save pw dialog from the autofill service that looks a bit outdated compared to the one provided by the One Tap library.

mco
  • 1,809
  • 15
  • 31