<suspend function returning too early> I have the ...
# stackoverflow
r
suspend function returning too early I have the below function which is completely 2 task asynchronously to upload data to Firebase. I need the 2nd function to return the documentId of new document created in Firebase and once done the main function returns this documentId so I can use it elsewhere. However, the return function is completing before the Firebase upload async functions have run and hence is returning an empty string. How can I fix this? suspend fun profileLiked(): String { var documentId: String = ""...