In my project, I’m trying to use google credential manager to store username and password of my users on their google account. based on the google documentation, I need to use the bellow code snippet to save credential:
val credentialManager = CredentialManager.create(context = this@MainActivity)
credentialManager.createCredential(
context = this@MainActivity,
request = CreatePasswordRequest(
id = "username",
password = "password"
)
)
but it seems it doesn’t work. and application won’t pass this line of code.
I tried to put two logs: one before this line and one after this line. and the log after this function was never printed.
however I won’t see any dialog neither. but if I press back button, the OS will show a message indicating: sign in has been canceled by application
.
what am I missing here?
I tried different method but nothing worked.