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?

google fcm tutorial page 8

 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

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -