System info
Issue occurs on:Android
Plugin name: Alarm Manager Plus
Plugin version: 1.2.0
Flutter doctor output:
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.5.1, on Microsoft Windows [Version 10.0.19043.1237], locale fa-IR)
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.8.6)
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.60.2)
[√] Connected device (4 available)
! Doctor found issues in 1 category.
Steps to Reproduce
final now = DateTime.now();
final tomorrow = DateTime(
now.year,
now.month,
now.day + 1,
23,
);
final duration = Duration(days: 1);
final result = await AndroidAlarmManager.periodic(
duration,
DAILY_ALARM_ID,
_showDailyNotificationForAndroid,
exact: true,
startAt: tomorrow,
wakeup: true,
rescheduleOnReboot: true,
);
static Future<void> _showDailyNotificationForAndroid() async {
/// show notification or what ever
}
Logs
[√] Flutter (Channel stable, 2.5.1, on Microsoft Windows [Version 10.0.19043.1237], locale fa-IR)
• Flutter version 2.5.1 at C:\FlutterSdk\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ffb2ecea52 (2 weeks ago), 2021-09-17 15:26:33 -0400
• Engine revision b3af521a05
• Dart version 2.14.2
[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at C:\AndroidSdk
• Platform android-30, build-tools 30.0.3
• ANDROID_HOME = C:\AndroidSdk
• ANDROID_SDK_ROOT = C:\AndroidSdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
X Android license status unknown.
Run `flutter doctor --android-licenses` to accept the SDK licenses.
See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.8.6)
• Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
• Visual Studio Community 2019 version 16.8.31019.35
• Windows 10 SDK version 10.0.18362.0
[√] Android Studio (version 2020.3)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
[√] VS Code (version 1.60.2)
• VS Code at C:\Users\asus\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.26.0
[√] Connected device (4 available)
• SM G955F (mobile) • 988a1b323750355946 • android-arm64 • Android 9 (API 28)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.19043.1237]
• Chrome (web) • chrome • web-javascript • Google Chrome 94.0.4606.61
• Edge (web) • edge • web-javascript • Microsoft Edge 94.0.992.31
! Doctor found issues in 1 category.
The Problem is when I set alarm like the one in above, it maybe work for first or second time but it would be trigger with 3 minute delay or skip a day or once I get reminder with 12 hours delay!!!!
There is this note in alarm manager doc. is this considered?!
Note: Beginning with API 19 (Build.VERSION_CODES.KITKAT) alarm delivery is inexact: the OS will shift alarms in order to minimize wakeups and battery use. There are new APIs to support applications which need strict delivery guarantees; see setWindow(int, long, long, android.app.PendingIntent) and setExact(int, long, android.app.PendingIntent). Applications whose targetSdkVersion is earlier than API 19 will continue to see the previous behavior in which all alarms are delivered exactly when requested.
Extra Information (Edited)
There is some case that the alarm goes off for greater good and if I reboot my phone, it will rescheduled.
System info
Issue occurs on:Android
Plugin name: Alarm Manager Plus
Plugin version: 1.2.0
Flutter doctor output:
Steps to Reproduce
Logs
The Problem is when I set alarm like the one in above, it maybe work for first or second time but it would be trigger with 3 minute delay or skip a day or once I get reminder with 12 hours delay!!!!
There is this note in alarm manager doc. is this considered?!
Note: Beginning with API 19 (Build.VERSION_CODES.KITKAT) alarm delivery is inexact: the OS will shift alarms in order to minimize wakeups and battery use. There are new APIs to support applications which need strict delivery guarantees; see setWindow(int, long, long, android.app.PendingIntent) and setExact(int, long, android.app.PendingIntent). Applications whose targetSdkVersion is earlier than API 19 will continue to see the previous behavior in which all alarms are delivered exactly when requested.
Extra Information (Edited)
There is some case that the alarm goes off for greater good and if I reboot my phone, it will rescheduled.