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.
You can use this firebase function in the onMessageReceived() method:
Long time = remoteMessage.getSentTime();
Hope this helps :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With