Questions tagged [firebase-realtime-database]

Firebase Realtime Database is a cloud hosted, NoSQL, JSON database that provides offline caching and synchronization. Do NOT use this tag for questions about Cloud Firestore; instead use the [google-cloud-firestore] tag.

About Firebase Realtime Database

Firebase Realtime Database is a component of the Firebase suite of tools for cross-platform application development.

  • Intuitive and easy-to-use API
  • Remains responsive regardless of network latency or Internet connectivity so your Firebase app works offline. Data synchronizes when connectivity returns
  • Handles the complexity of realtime synchronization and provides flexible conflict resolution
  • Accessible directly from client SDKs, or from your server with the REST API

To learn more: Firebase Realtime Database for SQL Developers (video series)

Related tags

40037 questions
5
votes
1 answer

How to only allow the user who “owns” the data to edit it? firebase

I have this data structure: I want to have a Firebase rule that allow user who owns a code snippet to be able to edit, but no one else. So in a way, it'll work like: Before data is added, everyone has access to add particular language When and…
KhoPhi
  • 9,660
  • 17
  • 77
  • 128
5
votes
0 answers

How to use firebase with ViewPager and FragmentPagerAdapter?

I have a situation when I have large set of data[Approx 1000+] in firebase database and I want to show those data in ViewPager with Fragments. So, like android firebase-ui library has adapter for ListView and RecyclerView which will handle the large…
jignesh.world
  • 1,396
  • 1
  • 11
  • 26
5
votes
5 answers

Angular2: *ngFor, AsyncPipe, and index

In a previous question here, I am trying to show a date only when it has changed between 2 messages. The difference is that I am now connected to a realtime database (Firebase), so I subscribe to the data source and pass it through the async pipe…
5
votes
1 answer

Firebase servers not reachable when using mobile phone data (3g/4g)

I was running some FireBase tests and suddenly I realized Firebase was not working anymore when using mobile data from Chile. At the beginning I thought the problem was my app so I tried to open a Firebase official example but I had no luck…
5
votes
3 answers

getItemCount() on Adapter is returning 0

I have created an adapter which is working fine. Now, I need to get a count of the no of data items in the adapter. i am using the function getItemcount() ,but I am getting a 0 every time. ALso, I am using Firebase for handling my database. final…
5
votes
1 answer

Is it possible to prevent Firebase's onDataChange() from being triggered initially?

Is it possible to make onDataChange() not be triggered just as you set the listener and instead only when the actual data changes?
kmindspark
  • 487
  • 1
  • 7
  • 18
5
votes
1 answer

Can't convert object of type java.util.ArrayList to type model

I'm trying to load data to RecycleView from Firebase. But I get convert error. com.google.firebase.database.DatabaseException: Can't convert object of type java.util.ArrayList to type uk.co.stableweb.kithunugee.model.Hymn at…
Isuru
  • 3,818
  • 13
  • 49
  • 64
5
votes
3 answers

Firebase Service Account Credentials Json Read permission denied

I downloaded my service account credential json file from Firebase console placed it earlier in the main directory of GAE endpoint project when I run my backed locally it gives Security exception. java.security.AccessControlException: access…
5
votes
2 answers

Firebase: How to run a callback after all the initial "child_added" calls?

When listening on the "child_added" event with: ref.on("child_added", function (snapshot) { }); This callback function will initially run once for every child that exists in the reference. This event will be triggered once for each initial child…
octopod
  • 824
  • 2
  • 10
  • 23
5
votes
2 answers

How to generate firebase uid

I am trying to store data (not users) in a Firebase backend. How do I generate Firebase unique identifer and store it in the child? I have been using firebase (DatabaseReference Key) as the unique identifier of a record nut the key is null.
Vincent Macharia
  • 475
  • 2
  • 7
  • 20
5
votes
0 answers

Revision history with firebase real time database

I'm the working on an online ide editor for students - codiva.io I'm planning to support collaboration and revision history, i see that firebase real time database would be great fit for this use case. Collaboration seems easy, but I couldn't find…
JackDaniels
  • 985
  • 9
  • 26
5
votes
1 answer

How to access Firebase data without using addValueEventListener

Is there a way to access firebase data without having to use the addValueEventListener? This way, I can access the data whenever I need, as opposed to being restricted to access it only when there is a data change. I am coding in Java. Thanks :)
kmindspark
  • 487
  • 1
  • 7
  • 18
5
votes
0 answers

Unreliable onDisconnect() in Firebase

I wrote following simple presence code in JavaScript (based upon https://firebase.google.com/docs/database/web/offline-capabilities#section-sample): var app = firebase.initializeApp(config); var mainRef = app.database().ref(); var session =…
5
votes
1 answer

Firebase Database - security consideration in an inverse index

In the Firebase guides, one of the recommendations is to maintain an inverse index to keep track of user actions. Here's a snippet of what I'm referring to: // An index to track Ada's memberships { "users": { "alovelace": { "name": "Ada…
5
votes
1 answer

Can I create a rule in firebase that will query a value in a push() array?

I only want the user to be able to load the group if they have the group in their list, how would I write a rule for that? Or is there a way to write a rule to look for a value in a firebase push array? For example I'd like to write a rule to…
Brandon
  • 2,034
  • 20
  • 25