Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to send a synchronous request in the Firebase?

I'm using Firebase Android SDK and became interested in sending synchronous request instead of asynchronous. According to the documentation, in any request callbacks are presented. But what about the synchronicity?

Thanks!

like image 913
Mark Korzhov Avatar asked Mar 03 '16 18:03

Mark Korzhov


People also ask

Is firestore asynchronous?

Since when reading data from firestore, it happens asynchronously.

Are firebase functions async?

Most of Firebase's APIs are asynchronous. This might be confusing at first: you're making a call, for example to fetch some data from Firestore, but you don't get a result back.

What is promise in firebase?

A promise represents an operation and the future value it may return. It also lets you propagate errors similar to try/catch in synchronous code. You can read about promises in the Firebase SDK on The Firebase Blog, and promises in general on MDN.


1 Answers

There is no way to synchronously load data from the Firebase Database.

While it is common for developers new to Firebase to wish for a synchronous method, it simply doesn't fit with Firebase's data synchronization model. Also see my answer here: Setting Singleton property value in Firebase Listener

like image 85
Frank van Puffelen Avatar answered Oct 19 '22 04:10

Frank van Puffelen