Zohab Ali Zohab Ali -4 years ago 138
Android Question

Get Notification received time in android

I am using Firebase to push notification from server to a specific android device. I want to get time when notification is received (device's local time not server time). How can I get that?

Because I have to show a timer with respect to that time so that is why I need that exact time when notification received on that device.

Thanks :)

Answer Source

I think an effective way would be use the Calendar class in your onMessageReceived() somewhat like this :

Calendar.getInstance().getTimeInMillis();
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download