How to call suspend function on init?
I'm a bit lost here, I dont quite get how suspend functions work yet so any tips or fix for this one?
init:
init {
val settings = FirebaseFirestoreSettings.Builder()
.setCacheSizeBytes(FirebaseFirestoreSettings.CACHE_SIZE_UNLIMITED)
.build()
db.firestoreSettings = settings
credentials = getCredentials() // Throws 'Suspend function 'getCredentials' should be called only from a coroutine or another suspend function'
}
Suspend function:
// ... this function is...