Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

alarm listener doesn't fire if app is in foreground #311

Open
ApplySci opened this issue Dec 26, 2024 · 2 comments
Open

alarm listener doesn't fire if app is in foreground #311

ApplySci opened this issue Dec 26, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ApplySci
Copy link

ApplySci commented Dec 26, 2024

Alarm plugin version
5.0.0-dev.4 and 4.1.1

Describe the bug
If the app is in the foreground when an alarm goes off, I get a notification. But the alarm listener doesn't get triggered. I'm using Alarm.ringStream.stream.listen(openAlarmPage), but that doesn't get triggered when an alarm starts ringing. In the debug console, I do see Flutter was notified that alarm 1 is ringing.

Additional context
I am using firebase cloud messaging and handlers for notifications from that, but they're not firing when an alarm sounds, either (not that I'd expect them too - I'm just adding this in case there's some weird collision there)

@ApplySci ApplySci added the bug Something isn't working label Dec 26, 2024
@ApplySci
Copy link
Author

ApplySci commented Dec 26, 2024

NB the listener fires properly on ipad, AFAICT - it's specifically an android issue.

Because of the new Play Store restrictions, I've got this in my AndroidManifest.xml:

    <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
    <uses-permission android:name="android.permission.USE_EXACT_ALARM" tools:node="remove"
        tools:ignore="ExactAlarm" />
    <uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" tools:node="remove" />

@ApplySci
Copy link
Author

ApplySci commented Dec 26, 2024

In AlarmPlugin.alarmTriggerApi?.alarmRang(id.toLong()), in debugging, I get:

FlutterError: Unable to establish connection on channel: 'dev.flutter.pigeon.alarm.AlarmTriggerApi.alarmRang'.

from a debugging line I added to check the success of that line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants