2

I'm developing an Android application and it's using the firebase to fetch its data. The onChildAdded() method in Firebase triggers off for all the children. Is there any hack to just get the newly added child alone?

PS: Each of the child has a date with it.

  • See https://gist.github.com/katowulf/6383103, https://stackoverflow.com/questions/33885059/how-to-only-get-new-data-without-existing-data-from-a-firebase, http://stackoverflow.com/questions/11788902/firebase-child-added-only-get-child-added and http://stackoverflow.com/questions/18270995/how-to-retreive-only-new-data (and probably many more). The first item in the Gist (and also what Tulio said in his answer) is going to be the most efficient. – Frank van Puffelen Apr 15 '16 at 13:57
  • @FrankvanPuffelen one answer a worse hack than the other. Is there still nothing better available? – Günter Zöchbauer Oct 13 '17 at 15:28

1 Answers1

2

You could save the last date you updated and then use it as reference to filter what is new.

Tolio
  • 1,023
  • 13
  • 30