I'm trying to add to the android push notification the timestamp when it was created. What is the best manner to implement that?
Thanks!
Open Settings app on your Android phone. Go to “Apps and notifications” and then tap on “Notifications”. Now tap on “Advanced” and finally tap on “Notification history“. On some phones it will be visible outside of the advanced category.
According to the Notification.Builder
documentation you can simply use the following:
setWhen(long when)
setShowWhen(boolean show);
When you set a timestamp with the setWhen(long when)
method, setShowWhen
is true
by default, so calling setShowWhen(true)
is optionally.
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