Web notifcation always makes 'default notification' sound on Android
Reported by
chem...@gmail.com,
Oct 20 2017
|
||||
Issue description
Steps to reproduce the problem:
1. Send a notification to a web app
2. The notification plays the 'default notification sound'
Example payload:
{ title: title,
options: {
tag: "some_id"
timestamp: new Date().getTime(),
body: Hello,
// silent: true, // disables vibration, too :(
sound: "", // doesn't work, neither does 'sound: null'
vibrate: [50,50,50],
renotify: true,
}}
What is the expected behavior?
There are two options/properties for controlling sound: "silent" and "sound". It seems obvious to use "silent" but that also disabled vibration (which I want). But setting "sound" to null or "" doesn't prevent Chrome/Android from playing the notification sound.
Checked on both Android 6.0 (Moto X 2013, LineageOS) and 8.0 (Pixel, Stock android), both have the problem.
What went wrong?
I want to be able to give my users an option to have no sound but still have vibration.
Did this work before? N/A
Does this work in other browsers? N/A
Chrome version: 61.0.3163.98 Channel: stable
OS Version: 8.0
Flash Version:
,
Oct 25 2017
Hi. Sry, I must've missed the email making me aware of a comment on my issue. I'll see what I can do.
,
Oct 25 2017
Thank you for providing more feedback. Adding requester "sandeepkumars@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 26 2017
Hmm creating a simple code example that demonstrates the issue is quite a lot of work since Chrome for Android only supports notifications through Service Worker. But! I did remember a demo app that was used to test some other notification-related functionality: https://tests.peter.sh/notification-generator/ It doesn't specifically give the option to set the 'sound' option but it *does* demonstrate that a notification triggers the default sound. Does this help? PS: Note sure if it helps but I tested this with a Moto X 2013 (LineageOS, Android 6.0) and Pixel 2016 (Stock, Android 8.0).
,
Oct 27 2017
Tested the issue using #61.0.3163.98 on Android 8.1.0; Pixel Build/OPM1.171019.004 and could observe the notification is making default android sound. Adding appropriate component's for further triaging of the issue. Thanks!!
,
Mar 9 2018
***Bulk edit*** Since there is no valid updates, closing for now. Feel free to reopen if needed.
,
Mar 10 2018
Ehm yes 8 think this still needs fixing..?
,
Mar 10 2018
..typo. 8 = I
,
Mar 12 2018
There's a few different things here -- 1) We don't support the "sound" attribute. It was removed from the standard a couple of weeks ago: https://github.com/whatwg/notifications/commit/459bf358cae197a5b88c6a227e018756ef4c21cd 2) The "silent" property indeed applies to both. As such, it's not currently possible to have the phone vibrate, but not make a sound. 3) On Android O neither "silent" nor "vibrate" will work at all, because of the way Android Notification Channels work. This is by design.
,
Mar 12 2018
@3) interesting because it does work for me (I use a vibration pattern and that works) even when I disable the Vibration toggle for the notif channel of my web app :P
,
Mar 12 2018
We create all our site notification channels with default importance and without any vibration pattern set. (Per-notification vibration patterns are now ignored.) It seems really unlikely that it works, and it definitely doesn't on stock Android O+ devices. Even if it does for you, don't expect it to work for your users.
,
Mar 12 2018
Hmm maybe it's because I granted the permission before the notif channels were implemented in chrome? Because it really does work. Pixel 2016 with what I believe is called stock android these days (as Nexus is pretty much dead) Anyway. This is offtopic so thanks for looking into the sound issue :) |
||||
►
Sign in to add a comment |
||||
Comment 1 by sandeepkumars@chromium.org
, Oct 23 2017Labels: Needs-triage-Mobile Triaged-Mobile Needs-Feedback