I am trying to make a upload to Firebase Storage inside a GcmTaskService. I want to make the upload synchronously but all uploads methods (putBytes, putFile...) are async.
I did not found any method to wait until the upload finishes. Is there any way to make the upload synchronously?
Connect to Firebase Scroll down to Storage and add Firebase to your project. Choose an existing project or create a new one then add Firebase Storage dependency. Head over to your project in the Firebase console and select Storage. Click on the Rules tab and we will change a minor thing.
Stay organized with collections Save and categorize content based on your preferences. Cloud Storage for Firebase allows you to quickly and easily upload files to a Cloud Storage bucket provided and managed by Firebase.
The new Firebase Storage is powered by Google Cloud Storage, giving it massive scalability and allowing stored files to be easily accessed by other projects running on Google Cloud Platform. Firebase now uses the same underlying account system as GCP, which means you can use any GCP product with your Firebase app.
Yes there is, if you are not on the UI thread, you can block until the task completes by using the method
com.google.android.gms.tasks.Tasks.await(task);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With