Is there a way to customize the sound for notification message on Android O and above?

未關閉
#754 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
3/5
預估耗時
1-2 天
新手友好度
35/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
android, firebase
領域
mobile

研究方向

從 Firebase Cloud Messaging notification payload 和 /res/raw 下的 custom.mp3 檔案開始,然後比較在 Android O 上以 API 23 和 API 26 為目標時的行為。當使用現有 notification message 的背景通知能夠播放自訂音效,且不需要在伺服器端改為 data message 時,即視為完成。

由索引模型根據 Issue 內容生成。

描述

api: messaging type: question

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.

主要語言
Kotlin
星號
9.3k
分支
7.4k
平均合併
7 天 9 小時
30 天內合併 PR
6

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

firebase/quickstart-android 的其他 Issue

查看 firebase/quickstart-android 的全部 Issue

相似的 Issue

更多 Kotlin Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。