Problem that Firebase Push Notification play first sound in the raw folder for phones above SDK 26
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 25/100
Direzione di ricerca
Non viene indicato alcun file del repository né alcun test. Inizia dal payload di remoteMessage.notification e confronta il percorso dei canali di notifica di Android 8+ che usa chan.setSound con il percorso precedente del notification builder che usa setSound. Riproduci il problema con i raw sounds elencati e verifica che su ogni versione di Android venga riprodotto il sound richiesto dal server, anziché la prima risorsa raw.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Firebase Push Notification play first a sound at raw for phones above SDK 26.
- raw
- car_park_empty.m4a
- car_park_full.m4a
remoteMessage.notification
{
"sound":"car_park_full",
"android_channel_id":"default_channel_id",
"data":{"carParkStatus":"true"}
}
playing a sound for android 8 and above
soundUri = if (aioNotification.carparkStatus) {
Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://"+ context.packageName + "/" + R.raw.car_park_empty_tr);
} else {
Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://"+ context.packageName + "/" + R.raw.car_park_full_tr);
}
}
val attributes = AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.setUsage(AudioAttributes.USAGE_NOTIFICATION)
.build()
if (soundUri != null) {
chan.setSound(
soundUri,
attributes
)
}
playing a sound for android 8 and below
var soundUri: Uri? = null
if (aioNotification.carparkStatus != null) {
soundUri = if (aioNotification.carparkStatus) {
Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://"+ context.packageName + "/" + R.raw.car_park_empty_tr);
} else {
Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE + "://"+ context.packageName + "/" + R.raw.car_park_full_tr);
}
}
if (soundUri != null) {
notificationCompatBuilder.setSound(soundUri)
}
but notification just play first sound in the raw folder.
example -->
- raw
- car_park_full.m4a
play => car_park_full
- raw
- car_park_empty.m4a
- car_park_full.m4a
play => car_park_empty
remoteMessage.notification
{
"sound":"car_park_full",
"android_channel_id":"default_channel_id",
"data":{"carParkStatus":"true"}
}
- raw
- abcde.m4a
- bcdea.m4a
- yery.m4a
Assuming that notification comes this way and that the raw folder is that way.
The sound that plays is abcde.m4a. So It's sound where first index in the raw folder.
Notification was sent from server.
Sound value was sent as 'car_park_full.m4a' from server but Sound value came as 'car_park_full' to client.
Does anyone know what the reason is?
- Lingua principale
- Kotlin
- Stelle
- 9.3k
- Fork
- 7.4k
- Merge medio
- 7g 9h
- PR unite (30g)
- 6
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di firebase/quickstart-android
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
firebase/quickstart-android#2756 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
firebase/quickstart-android#2754 · 5 commenti · 1 reazione ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 32/100
firebase/quickstart-android#2668 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
firebase/quickstart-android#2663 · 1 commento ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
firebase/quickstart-android#1669 · 3 commenti ·
Tutte le issue di firebase/quickstart-android
Issue simili
-
android:plan main:plan packages:learn
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
Needs Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
ankidroid/Anki-Android#23453 ·
I maintainer di solito rispondono entro 1 giorno
-
afk-ok area:data-quality importer size:S
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
enorm-labs/event-junkie#5278 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
bazel-contrib/rules_kotlin#1846 ·
I maintainer di solito rispondono entro 2 giorni