I’m trying to implement the new sign in method since the old one is what what ever the hell reason deprecated, but the google docs are as always incomplete.
This is the part I’m current at:
coroutineScope.launch {
try {
val result = credentialManager.getCredential(
request = request,
context = this,
)
handleSignIn(result)
} catch (e: GetCredentialException) {
handleFailure(e)
}
}
coroutineScope is unresolved referrence
I’m watching this tutorial:
https://www.youtube.com/watch?v=P_jZMDmodG4
and the guy there just does:
val coroutineScope = rememberCoroutineScope()
and it works for him, but for me rememberCoroutineScope() is also unresolved referrence
How to make it work?
Thanks in advance
>Solution :
There are various ways to obtain a CoroutineScope, the most common being either in a suspend function and calling coroutineScope { ... } (or withContext and similar) or being in a @Composable function and calling rememberCoroutineScope().
The latter seems to be what was used in your example.