How do I get a server timestamp from Firebase's iOS API?

后端 未结 4 673
迷失自我
迷失自我 2020-12-25 15:23

I have an iOS app that uses Firebase and currently has a few dictionaries with keys that are NSDate objects. The obvious issue with this is that NSDate draws from the devic

4条回答
  •  不思量自难忘°
    2020-12-25 15:39

    Caveat: Seems like the timestamp is added AFTER your object is persisted in Firebase. This means that if you have a .Value event listener set up on the location your object is persisted to, it will be triggered TWICE. Once for the initial object being stored in the location, and again for the timestamp being added. Struggled with this issue for days :(

    Helpful information for anyone else who can't figure out why their event listeners are triggering twice/multiple times!

提交回复
热议问题