alarm
alarm copied to clipboard
Uses the default alarm of system
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.
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