Problem that Firebase Push Notification play first sound in the raw folder for phones above SDK 26
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 25/100
调研方向
未指定仓库文件或测试。请从 remoteMessage.notification payload 开始,将使用 chan.setSound 的 Android 8+ 通知渠道路径与使用 setSound 的较旧通知构建器路径进行比较。使用列出的 raw sounds 重现,并验证在每个 Android 版本上播放的是服务器请求的 sound,而不是第一个 raw 资源。
由索引模型根据 Issue 内容生成。
描述
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?
- 主要语言
- Kotlin
- 星标
- 9.3k
- 派生
- 7.4k
- 平均合并
- 7 天 9 小时
- 30 天内合并 PR
- 6
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
firebase/quickstart-android 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 35/100
firebase/quickstart-android#2756 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 35/100
firebase/quickstart-android#2754 · 5 条评论 · 1 个 reaction ·
-
难度 4/5 3-5 天 新手友好度 32/100
firebase/quickstart-android#2668 ·
-
难度 4/5 3-5 天 新手友好度 25/100
firebase/quickstart-android#2663 · 1 条评论 ·
-
难度 4/5 3-5 天 新手友好度 25/100
firebase/quickstart-android#1669 · 3 条评论 ·
查看 firebase/quickstart-android 的全部 Issue
相似的 Issue
-
android:plan main:plan packages:learn
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 86/100
维护者通常 1 天内回复
-
Needs Triage
难度 2/5 1-3 小时 新手友好度 72/100
ankidroid/Anki-Android#23453 ·
维护者通常 1 天内回复
-
afk-ok area:data-quality importer size:S
难度 2/5 1-3 小时 新手友好度 78/100
enorm-labs/event-junkie#5278 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
bazel-contrib/rules_kotlin#1846 ·
维护者通常 2 天内回复