lets say we have a button called "AddItemButton", so that each time we click the button we should add a push id along with a certain value in the database at (Items) node.
looks like this:
//on click AddItemButton
DatabaseReference items=FirebaseDatabase.getInstance().getReference();
//push an item
items.child("Items").push();
//add to database
items.setValue("new_item").addOnCompleteListener(new onCompleteListener..{
//when completed the write add data to (Items_2) node
DatabaseReference items_another=FirebaseDatabase.getInstance().getReference();
items_another.child("Items_2").push();
items_another.setValue("new_item");
});
So as you see its a basic way to add data to (Items) and once completed another write is added to (Items_2).
Going Offline now
If I go offline now and click the button 2 times. I know that I cached 2 writes to my disk (because I enabled persistance);
Going Online now
If I go now online the 2 writes of (Items) is added, while at (Items_2) nothing is added (they are lost).
Question 1
Does firebase also allow to catch Completion Listener associated which each write offline?
If yes then, why its not persisted in my case?
Question 2
Do we have a limit for cached writes?
Thank you.