I'm making an app and I've run into a problem with Firebase's Database and Authentication services.
After a while, while I am authenticated (using Firebase Auth) and using my app, my database ValueEventListeners don't seem to be called, even though there is data in the database.
How I'm adding my listeners:
FirebaseDatabase
.getInstance()
.getReference()
.child("my_child")
.addValueEventListener(new ValueEventListener()
{
@Override
public void onDataChange(DataSnapshot dataSnapshot)
{
Log.d("App", "onDataChange");
}
@Override
public void onCancelled(DatabaseError databaseError)
{
}
});
Stuff I've tried:
- Checking the database rules (after a relog reading is fine - but simulated reads pass even while authenticated & unauthenticated)
- keepSynced(true) on the DatabaseReferences
- Adding the listeners in the Activity's onCreate instead of the Application's onCreate
- Adding/removing/updating data in the database to trigger a sync
- Rebooting
Any help would be much appreciated.