Below code is not working for Android Version 13 and above but same code is working for Android 12.
This code is not showing pop up to save credential neither its throwing any exception
try {
//Ask the user for permission to add the credentials to their store
val result = credentialManager.createCredential(
request = CreatePasswordRequest(username, password),
context = context,
)
Log.v("CredentialTest====>", result.data.toString())
} catch (e: CreateCredentialCancellationException) {
//do nothing, the user chose not to save the credential
Log.v("CredentialTest", "User cancelled the save")
} catch (e: CreateCredentialException) {
Log.v("CredentialTest", "Credential save error", e)
}
}
I tried above code I want to see Save Credential pop up on Login Succesful.