Problem/Motivation
We send a message with firebase, but it plays no sound on the receiving devices.
A little bit more detail: we use it in a pwa-environment. When you use "add to homescreen" (pwa-default) it actually does play sound. But we also use it in an app, with pwabuilder, en in these apps no sound is played.
Steps to reproduce
Create a pwa, than package it with pwabuilder and publish it. Push a test-notification to a device.
Proposed resolution
Add $message = $message->withDefaultSounds();.
User interface changes
None
API changes
None
Data model changes
None
Comments
Comment #3
joshahubbers commentedI added the patch to enable sound by default. It follows the device setting of course, so when sounds are muted a buzz is played, or nothing at all, depending on the user phone preference.
It could be a new parameter of the function, but this is the less intrusive way, I thought.
Comment #4
joshahubbers commentedAlso fixed some pipeline-things. Only composer next minor fails. Don't know why exactly.
Comment #5
ptmkenny commentedHi, thanks for this MR. I think this is a good change but please submit a new MR that only has the fix for playing a sound; the pipeline stuff should be fixed in a separate issue.
Comment #7
ptmkenny commentedComment #8
ptmkenny commentedI'm going to add a new argument, $silent, to the API to enable people to get silent notifications if necessary.
Comment #10
ptmkenny commentedComment #11
ptmkenny commented@joshahubbers Ok, I created a new branch that adds a preference (default: sound on) to override the behavior. Please test it and let me know if it works for you.
Comment #12
ptmkenny commentedComment #14
ptmkenny commentedOk, I was able to get this all working on my setup, so I'm going to commit. To be honest, I never tested notifications with sound because I don't use them personally so I didn't realize this had to be added. It's fixed now though, many thanks!
Comment #16
joshahubbers commentedHi PTMkenny, Sorry for my late response. I was on vacation. Thanx for committing it and making it a setting. Nice!
Comment #17
ptmkenny commentedWelcome back and I'm glad this solution works for you!