Firebase anonymous sign in returns a task (which is basically Google promise implementation):
val task:Task<AuthResult> = FirebaseAuth.getInstance().signInAnonymously()
How it would be possible create a signInAnonymous
wrapper where:
It is a suspend
function, waiting for the task
completion
suspend fun signInAnonymous(): Unit
It returns a Deferred
object, delivering the result asynchronously
fun signInAnonymous() : Deferred
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…