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
android 13 scheduled alarms vs exact alarms #1906
Comments
Could you to help look into this? There isn't a team that works on the plugin as it's maintained by myself (during my spare time) with contributions by the community |
This will help https://www.youtube.com/watch?v=aQTvI8L-mZs |
It seems that "SCHEDULE_EXACT_ALARM" is limited by the system, A simple workflow is to catch try {
await flutterLocalNotificationsPlugin.zonedSchedule(
0,
'scheduled title',
'scheduled body',
tz.TZDateTime.now(tz.local).add(const Duration(seconds: 5)),
const NotificationDetails(
android: AndroidNotificationDetails(
'your channel id', 'your channel name',
channelDescription: 'your channel description')),
androidScheduleMode: AndroidScheduleMode.exactAllowWhileIdle,
uiLocalNotificationDateInterpretation:
UILocalNotificationDateInterpretation.absoluteTime);
} on PlatformException catch (e) {
debugPrint(e.message); //Caller com.your.package needs to hold android.permission.SCHEDULE_EXACT_ALARM or android.permission.USE_EXACT_ALARM to set exact alarms
// handle failure logic here
}
|
Any update on this issue. I am facing this issue in android 14.
Doctor summary (to see all details, run flutter doctor -v): • No issues found! |
Happeing on Android 13, when calling Affected devices (all Android 13):
Not reproducable so far on:
flutter_local_notifications version used:
Stacktrace:
I cannot reproduce this bad behaviour on other devices. Reported via Crashlytics. |
@timobaehr your issue isn't directly (emphasis on directly) related to what was raised by @hichaudh. The point raised by @hichaudh is around how to handle behavioural changes in Android 14. What you're seeing isn't a device-specific either that trying to reproduce this on different devices won't help. If you look the stack trace then this permissions related that means app had a permission revoked that impacts the ability to send a notification at the exact time. Your issue was already reported in #1526 and 14.0.0 made some changes to log an error instead of resulting in a crash and also allowed apps to schedule notifications with inexact timings should they choose to do so |
Changes have been done as part of the 16.0.0 prerelease relating to this and details have been added to the readme as well |
according to android 14. apps using SCHEDULE_EXACT_ALARM will not be enabled by default: https://developer.android.com/about/versions/14/changes/schedule-exact-alarms
Just curious whether this has been recognized by the plugin team and whether there will be any necessary changes to usage of the plugin etc.
Would also be nice to see an update to documentation whether on here or pub.dev
The text was updated successfully, but these errors were encountered: