Notification sound on API 26

后端 未结 6 1563
清酒与你
清酒与你 2020-12-09 02:02

I have a custom mp3 sound that I use on my notifications. It works fine on all devices below API 26. I tried to set the sound on Notification Channel also, but still no work

6条回答
  •  时光取名叫无心
    2020-12-09 02:21

    The default sound overrides any sound.

    You need to put this in your code:

    notification.defaults = Notification.DEFAULT_LIGHTS | Notification.DEFAULT_VIBRATE;
    

    Reference:

    Android notifications

提交回复
热议问题