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

Issue with Android 14 #2316

Open
p3pp8 opened this issue May 3, 2024 · 3 comments
Open

Issue with Android 14 #2316

p3pp8 opened this issue May 3, 2024 · 3 comments

Comments

@p3pp8
Copy link

p3pp8 commented May 3, 2024

Hello there, i'm facing an issue with a device running on Android 14 OS, the device is Galaxy A23 5g.
I followed the configuration steps and everything seem to be ok, i set permission to use SCHEDULE_EXACT_ALARM and request permission for OS 14 as described in the guide but when i run my application it opens the alarms permission screen but the authorization switch is locked and i'm not able to enable it, so the plugin initialization fails with:

Unhandled Exception: PlatformException(exact_alarms_not_permitted, Exact alarms are not permitted, null, nul

Of course adding USE_EXACT_ALARMS permission everything works just fine but as you know this permission is subject to vendor revision.

Any help really appreciated!

@adnanjpg
Copy link

adnanjpg commented May 4, 2024

please first of all make sure you're on the latest version.

if you're not building an alarm app, setting zonedSchedule method's androidScheduleMode parameter to AndroidScheduleMode.inexact or AndroidScheduleMode.inexactAllowWhileIdle will fix this for you.

final myinst = FlutterLocalNotificationsPlugin();
myinst.zonedSchedule(
            ...,
            ...,
            ...,
            ....,
            ...,
            androidScheduleMode: AndroidScheduleMode.inexactAllowWhileIdle, // or AndroidScheduleMode.inexact
);

@p3pp8
Copy link
Author

p3pp8 commented May 6, 2024

Hello, thank You for the answer! Yes i'm using latest version of the plugin but unfortunately setting to mode inexact doesn't solve the issue, the switch button in system alarms and reminders screen is still locked.

@p3pp8
Copy link
Author

p3pp8 commented May 7, 2024

@adnanjpg Yes, it works, even when permission switch is locked. It solved the issue. Thank You!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants