gdelataillade / alarm

A Flutter plugin to easily manage alarms on iOS and Android
https://pub.dev/packages/alarm
MIT License
132 stars 86 forks source link

In version 3.0.0 or 3.0.1, alarm can't play a local sound file. #123

Closed pyjserv closed 11 months ago

pyjserv commented 11 months ago

Alarm plugin version 3.0.1

Describe the bug In version 2.1.1 or older, the alarm could play assets and local sound files. However, in version 3.0.0 or 3.0.1, no sound is played when referencing a local file.

Device info Android 13

gdelataillade commented 11 months ago

Hi @pyjserv

I forgot to add this feature when I moved Android alarm logic to native code... I'll fix it soon.

Thanks for reporting this issue.

gdelataillade commented 11 months ago

Hi @pyjserv

I just released version 3.0.2 with a fix for your issue.

You will have to add this permission in your android manifest: <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

You may also have to request the access external storage permission in your app. You can use package permission_handler. You can see how I did in the ExampleAlarmHomeScreen in my example app.

pyjserv commented 11 months ago

Hi @gdelataillade

Thank you for fixing the issue so quickly. I just tested the function to play local audio files, and the alarm is working fine.

gdelataillade commented 11 months ago

Awesome. I'm closing the issue then.