javascript - Save on FCM database message's timestamp -
so i'm using follow steps tutorial in order understant fcm , i'm wondering if there anyway save timestamp send/recieved messages?
this.messagesref.push({ name: currentuser.displayname, text: this.messageinput.value, photourl: currentuser.photourl || '/images/profile_placeholder.png' })
as can see on sample code push name, text , photourl want time.
use gettime() method, returns number of milliseconds between midnight of january 1, 1970 , specified date.
time: new date().gettime()
sample code:
this.messagesref.push({ name: currentuser.displayname, text: this.messageinput.value, photourl: currentuser.photourl || '/images/profile_placeholder.png', time: new date().gettime() })
Comments
Post a Comment