bartolomej/rn-alarm

How to set custom sound in this Alarm App

Opened this issue · 1 comments

My main target is to set Text-To-Speak in Alarm Sound, Can you help me in this regard

@akhzarna Hi, sure. So the actual alarm (sound, vibration,..) is treated as a normal notification, as you can see here.

Back when I created this, you could just use NotificationBuilder#setSound (used here in rn-alarm codebase) to set a custom sound, but now it's deprecated since API level 26.

Instead of that, you now need to create a NotificationChannel and call setSound on that object, see documentation. Later on you can assign a notification channel to a NotificationBuilder object, as seen in constructor documentation.

I think this is a (hopefully correct) high level overview of needed changes. Note that I didn't test my instructions in a real app, so you may need to add additional code in order for this to work.