1

In my iOS app, I send message information to the Firebase Database using childByAutoId for the key for each message. Currently the keys are ordered with oldest messages at the top of the node.

How can I configure the database via its rules so that the newest messages are at the top of the messages node?

I want it to be structured this way so that when I make my first call to firebase to fetch the latest batch of message in viewDidLoad() I can populate my table as soon as possible

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Edward
  • 2,864
  • 2
  • 29
  • 39
  • 1
    There is no server-side way to configure data in lists to be reversed. Common solutions are to reverse the data client-side or to add an inverted property to the data, which will return the data in the correct order. I recommend scanning a few answers in this list: http://stackoverflow.com/search?q=%5Bfirebase%5D+descending – Frank van Puffelen Dec 19 '16 at 17:48
  • Thanks @FrankvanPuffelen - will look into the list. Keep up the great work :) – Edward Dec 19 '16 at 18:24

0 Answers0