New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 776715 link

Starred by 2 users

Issue metadata

Status: WontFix
Owner: ----
Closed: Mar 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

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:
 
Cc: msrchandra@chromium.org nyerramilli@chromium.org sandeepkumars@chromium.org
Labels: Needs-triage-Mobile Triaged-Mobile Needs-Feedback
@chemo.b: Thanks for the report!!

Could you please help us with sample .apk file which causes the issue, details of device and if possible attach a screencast as well. That would help us in further triaging of the issue.

Thanks!!

Comment 2 by chem...@gmail.com, 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. 
Project Member

Comment 3 by sheriffbot@chromium.org, Oct 25 2017

Labels: -Needs-Feedback
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

Comment 4 by chem...@gmail.com, 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).
Components: Blink>PushAPI UI>Shell>Notifications
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!!
Status: WontFix (was: Unconfirmed)
***Bulk edit***

Since there is no valid updates, closing for now. Feel free to reopen if needed.

Comment 7 by chem...@gmail.com, Mar 10 2018

Ehm yes 8 think this still needs fixing..?

Comment 8 by chem...@gmail.com, Mar 10 2018

..typo. 8 = I

Comment 9 by peter@chromium.org, 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.

Comment 10 by chem...@gmail.com, 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

Comment 11 by peter@chromium.org, 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.

Comment 12 by chem...@gmail.com, 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