function?
What am I doing wrong?
(part in red says):
Copy code
return is not allowed here
r
ribesg
02/24/2020, 1:26 PM
You’re trying to return synchronously in an asynchronous code.
o
Ofir Bar
02/24/2020, 1:33 PM
@ribesg
Can you please help? I am really short on time
I need to upload a file to Firebase (uses Firebase callbacks), get that file download URL(uses Firebase callbacks), and sent it to my backend (uses coroutines)
How can I combine the code above which uses Firebase callbacks with my backend coroutines call? (approximately, pseudocode is good too)
This is my method that sends the file download URL to my backend:
r
ribesg
02/24/2020, 1:34 PM
Your function simply cannot return a String because it’s using callbacks, you could add a callback parameter of type
(String) -> Unit
to that function and call it instead of trying to return