Notifications don't show 'time' when timestamp is provided
Reported by
chem...@gmail.com,
Oct 26 2017
|
||||||||||
Issue descriptionSteps to reproduce the problem: 1. Go to this notification demo page: https://tests.peter.sh/notification-generator/ 2. Set the timestamp to a value (for example, "5 minutes ago") 3. Click the "show the notif" button What is the expected behavior? I expect the notification on Android to show the time corresponding to the timestamp What went wrong? It doesn't show. Did this work before? N/A Does this work in other browsers? N/A Chrome version: 62.0 Channel: stable OS Version: 8.0 Flash Version: Not sure if this only happens on Android 8.0 but I am pretty sure it used to work with earlier versions of Chrome on Android 6.0.
,
Oct 27 2017
See attached screenshot. Google Inbox shows the time in the first line (at the end). The notification above it doesn't (that's the one I created via a service worker). I'm pretty sure this used to work on Android 6.0 and an older version of Chrome on my Moto X 2013. According to this Platform Status document it should work as it says it's enabled by default starting with Chrome v50: https://www.chromestatus.com/feature/5899831990026240
,
Oct 27 2017
Thank you for providing more feedback. Adding requester "msrchandra@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 30 2017
As per Comment# 2, assuming that the issue is not related to Chrome and is related to Android Notifications. Adding related component, could some one please look into the issue and provide an update. Thanks in Advance.
,
Oct 30 2017
,
Oct 30 2017
It looks like this changed in Android 7.0 and up: "Add a timestamp pertaining to the notification (usually the time the event occurred). For apps targeting N and above, this time is not shown anymore by default and must be opted into by using setShowWhen(boolean)" https://developer.android.com/reference/android/app/Notification.Builder.html#setWhen(long) Is it possible that Chrome uses setWhen and not setShowWhen?
,
Oct 30 2017
Thank you for providing more feedback. Adding requester "msrchandra@chromium.org" to the cc list and removing "Needs-Feedback" label. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Oct 30 2017
,
Nov 1 2017
,
Nov 2 2017
Thanks for the bug report chemo.b@ Your comment in #6 is correct - indeed Chrome calls setWhen with either the current timestamp or a custom timestamp if one is provided, and does not currently call setShowWhen(true), so the difference you observe is due to the different default showWhen behaviour on different versions of Android. @Owen what do you think we should do here? It would be tricky to only show the timestamp if the web developer provides one, so I propose we either: 1. Start always showing the timestamp on all versions of Android 2. Do nothing and leave this as WAI.
,
Nov 2 2017
I think we should just always show it. Deciding to only show the timestamp if the developer provided one is tricky because the spec defines that it defaults to the time of posting, so we'd need a whole lot of logic to be able to distinguish those cases. Deciding not to show the timestamp at all means we've dropped the feature, and should go through the Blink deprecation process. Personally I think that knowing *when* a notification was, or will be relevant is a good feature. Most apps on my device (including various Google ones) show the timestamp too.
,
Nov 2 2017
+1, always showing it sounds reasonable to me, and like the easiest option. I suggest we do that and then only revisit if somebody complains that they do not want a timestamp to be shown, at which point it seems we'd have the option of attempting to update the spec or something else complicated.
,
Nov 2 2017
Sgtm. I'll submit a patch today so this change will be in our next release (Chrome version 64). Thanks all.
,
Nov 2 2017
* Make that tomorrow. https://chromium-review.googlesource.com/c/chromium/src/+/749403
,
Nov 2 2017
Great, thanks guys/gals/others :) Just a suggestion regarding the "not showing the timestamp"; maybe if the developer sets the timestamp to '0' or '-1' it could be ignored?
,
Nov 3 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2afba10191425c4ec8ea2b8e54c4853423e4cee8 commit 2afba10191425c4ec8ea2b8e54c4853423e4cee8 Author: Anita Woodruff <awdf@chromium.org> Date: Fri Nov 03 17:13:31 2017 [Android web notifications] Always show timestamp - Previously, we always set a timestamp on web notifications, but we defaulted to Android to decide whether or not to show it. - Now we ensure the timestamp is always shown, regardless of Android version. Bug: 778599 Change-Id: I17a6a8ee1ef8d847b64364125dfb2234c84d65d4 Reviewed-on: https://chromium-review.googlesource.com/749403 Commit-Queue: Anita Woodruff <awdf@chromium.org> Reviewed-by: Peter Beverloo <peter@chromium.org> Cr-Commit-Position: refs/heads/master@{#513812} [modify] https://crrev.com/2afba10191425c4ec8ea2b8e54c4853423e4cee8/chrome/android/java/src/org/chromium/chrome/browser/notifications/CustomNotificationBuilder.java [modify] https://crrev.com/2afba10191425c4ec8ea2b8e54c4853423e4cee8/chrome/android/java/src/org/chromium/chrome/browser/notifications/StandardNotificationBuilder.java [modify] https://crrev.com/2afba10191425c4ec8ea2b8e54c4853423e4cee8/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationPlatformBridgeTest.java [modify] https://crrev.com/2afba10191425c4ec8ea2b8e54c4853423e4cee8/chrome/android/javatests/src/org/chromium/chrome/browser/notifications/NotificationTestUtil.java
,
Dec 20 2017
,
Jan 9 2018
|
||||||||||
►
Sign in to add a comment |
||||||||||
Comment 1 by msrchandra@chromium.org
, Oct 27 2017Labels: Needs-triage-Mobile Triaged-Mobile Needs-Feedback