Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Firebase Storage upload synchronously

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?

like image 210
9and3r Avatar asked May 27 '16 12:05

9and3r


People also ask

How do I upload multiple images to Firebase Storage?

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.

Can I upload folder in Firebase Storage?

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.

Is Firebase Storage same as Google Cloud Storage?

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.


1 Answers

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);

like image 112
Benjamin Wulfe Avatar answered Jan 02 '23 19:01

Benjamin Wulfe