firebase / firebase/quickstart-android
Is there a way to customize the sound for notification message on Android O and above?
- Vorherrschende Sprache
- Kotlin
- Sterne
- 9.3k
- Forks
- 7.4k
- Ø Merge
- 2 T. 19 Std.
- Gemergte PRs (30 T.)
- 8
Beschreibung
The push message is like
```
"notification" : {
"body" : "This is a Firebase Cloud Messaging",
"title" : "FCM Message",
"sound":"custom"
}
```
And the custom.mp3 is in /res/raw
It works fine when my project target api 23, but it does not work when target api 26 on Android O.
Both target api 23 and target api 26, the notifications are shown by the system if the app is in background. I don't know what has changed on Android O.
I don't want to change the notification message to data message on the server side because it affects a lot. Is there an easy way to solve the issue?
Thanks.
Beitragsleitfaden
Rechercherichtung
Beginne mit dem Firebase Cloud Messaging notification payload und der Datei custom.mp3 unter /res/raw und vergleiche anschließend das Verhalten beim Targeting von API 23 und API 26 unter Android O. Erledigt ist die Aufgabe, wenn eine Hintergrundbenachrichtigung unter Verwendung der vorhandenen notification message den benutzerdefinierten Ton abspielt, ohne eine serverseitige Änderung zu einer data message zu erfordern.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- android, firebase
- Bereich
- mobile
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100