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

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -