Timestamp missing in notification banner [Android]
See original GitHub issueBug
Timestamp is missing at Android Notification Banner. At the screenshot below, you’ll see timestamp of 1m & 16h is at the top of the notification.
Environment info
Tested with Physical Device on Samsung Android OS: Android version 10
react-native info
output:
OS: macOS 10.15.4
CPU: (4) x64 Intel(R) Core(TM) i5-6360U CPU @ 2.00GHz
Memory: 1.43 GB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.10.0 - /usr/local/bin/node
Yarn: 1.19.0 - /usr/local/bin/yarn
npm: 6.12.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 13.6, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 23, 28, 29
Build Tools: 28.0.3, 29.0.2, 29.0.3
System Images: android-21 | Google APIs ARM EABI v7a, android-21 | Google APIs Intel x86 Atom_64, android-23 | Google APIs ARM EABI v7a, android-23 | Google APIs Intel x86 Atom_64, android-24 | Google APIs Intel x86 Atom_64, android-26 | Google Play Intel x86 Atom
Android NDK: 19.2.5345600
IDEs:
Android Studio: 3.6 AI-192.7142.36.36.6308749
Xcode: 11.6/11E708 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.61.5 => 0.61.5
npmGlobalPackages:
create-react-native-module: 0.19.0
react-native-cli: 2.0.1
“react-native-push-notification”: “^5.1.1”,
Steps To Reproduce
- Send notification to mobile
- Upon receive notification banner, pull down notification tray
- See notification banner with timestamp …
Describe what you expected to happen:
Expect to see timestamp, eg (now, 4m, 6h)
Reproducible sample code
The following code is under .configure
PushNotification.configure({
onNotification: (notification) => {
PushNotification.localNotification({
showWhen: true,
title: notification.data.gcm_title,
message: notification.data.message,
userInfo: notification.data,
})
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
Why doesn't the time show up in notifications? : r/GooglePixel
When I view notifications, the clock in the status bar is replaced with the date, but most of the time I'm interested in...
Read more >Notifications Overview | Android Developers
When you issue a notification, it first appears as an icon in the status bar. ... Users can swipe down on the status...
Read more >android - Notification not firing at correct time - Stack Overflow
This is just a timestamp that will be displayed to the user. ... This is not the time when the notification will go...
Read more >No timestamp in missed call notification - OnePlus Community
When a call is missed, a notification appears in the notification bar. This notification doesn't have the timestamp (eg. "1h") that shows how...
Read more >Date missing from notification bar [189569006] - Issue Tracker
For exact build reference, please see the attached bugreport.) ... What steps would let us observe this issue? 1. Pulling down the notification...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Dallas62 I have managed to get the timestamp appear! So the key is to pass
new Date().getTime()
towhen
field. We do not need the fieldusesChronometer
, otherwise the timestamp will keep running like a stopwatch.Thanks for your help! (:
Here’s the final look of the code
Yea, i notice that actually. But can you show me an sample value for
when
field? I tried to add11:30 AM
STRING earlier, didn’t work out.Update 1.0
I think the timestamp value should be
1320917972
correct?I actually dived into library by adding
.setWhen(System.currentTimeMillis())
toNotificationCompat.Builder
which end up like …but still result the same.
Tested with Physical Device