Open warrenrhodes opened 1 year ago
Hi @warrenrhodes,
Sorry for the late reply.
I'm not sure to understand your request. You would like the plugin to have a default alarm sound in case the user does not specify one ? Please explain with more details.
@gdelataillade Yeah. At the time I wanted to use this package, the assetAudioPath
field was required, so I'm wondering if the user wants to use a currency's default notification song, how does he do it?
The issue is that Flutter itself doesn't provide a direct API to access the default system sounds for alarms, notifications, or ringtones on either iOS or Android.
However, I could import the alarm audio files it in the plugin itself but it would add weight to the plugin which is not ideal.
What do you think ?
@gdelataillade Oh i see. Can you provide the same approach as FlutterLocalNotification package (use the default sound in case of null file)? If not, I have a preference for your first approach, passing the sound file.
The issue is that I can't just play the default notification sound because the plugin relies on the fact that I have an audio file to play at a given time. If it was not the case, alarm would less reliable (app background processes would be killed).
On iOS: Audio Background Mode On Android: Foreground Service with type mediaPlayback
The issue is that I can't just play the default notification sound because the plugin relies on the fact that I have an audio file to play at a given time. If it was not the case, alarm would less reliable (app background processes would be killed).
On iOS: Audio Background Mode On Android: Foreground Service with type mediaPlayback
On Android, you can use RingtoneManager.TYPE_ALARM to get the URI of the default alarm sound. Same for TYPE_NOTIFICATION and TYPE_RINGTONE
@gdelataillade any updates about this one?? this a must
@IldySilva I haven’t had time to work on this yet, but I see it is highly requested. I’ll increase its priority and keep you updated.
Each device alarm system is unique, and it should be great to let the user give the alarm path or not. Without an alarmPath, the default alarm system will be used.