mco*_*mco 5 android google-signin google-one-tap
我正在尝试实现 Android 一键登录,但无法在此处显示此对话框:
我不断收到消息:com.google.android.gms.common.api.ApiException: 16: Skipping password saving since the user is likely prompted with Android Autofill.
我怎样才能解决这个问题?
代码:
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
}
}
Run Code Online (Sandbox Code Playgroud)
文档:https://developers.google.com/identity/one-tap/android/save-passwords
mco*_*mco -2
我发现只有当您关闭手机上的自动填充服务时,才会显示“一键登录”中的保存密码对话框。您可以通过转至 来执行此操作Settings > Languages & input > Advanced > Autofill Service。
如果自动填充打开,您将从自动填充服务中获得保存密码对话框,与一键库提供的对话框相比,该对话框看起来有点过时。
| 归档时间: |
|
| 查看次数: |
973 次 |
| 最近记录: |