What does com.firebase.client.ServerValue.TIMESTAMP respong with?

后端 未结 1 1707
难免孤独
难免孤独 2021-01-16 13:43

I\'m trying to build off a chat application using Firebase on the web, and create and Android client. In my web app, I send the Firebase Server\'s time stamp along with the

1条回答
  •  隐瞒了意图╮
    2021-01-16 14:20

    It is too long to go into comment. I meant more something like this, which I used on number of occasions.

    var chatUserRef = new Firebase("your url to chat user");
    chatUserRef.child('time')
      .set(Firebase.ServerValue.TIMESTAMP)
      .on('value', function(snapshot){
         var current_server_time = snapshot.val();
      });
    

    It is in javascript nevertheless the principle should be the same in Java.

    0 讨论(0)
提交回复
热议问题