You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You'll need to do some runtime checks and requests:
you must request permissions from the user the first time you try to schedule exact alarms
even so, the user can revoke permissions at any time, so always check if you don't want the error
// Returns the Android version of the plugin on Android devices, null everywhere elsefinal androidPlugin = localNotificationsPlugin.resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>();
// Check if you still have permission from last time you asked (or false if you never asked)// Null means you're not on Androidvar hasPermission =await androidPlugin?.canScheduleExactNotifications() ??false;
if (!hasPermisssion) {
// Request permissions again and update the variable
hasPermission =await androidPlugin?.requestExactAlarmsPermission();
}
// You may have been denied permissions, so check the return valueif (hasPermission ??false) {
await localNotificationsPlugin.zonedSchedule(...);
}
See also: this section of the new Android setup guide. If this works for you, please let us know by closing the issue.
Describe the bug
I use my app to register alarm to exact weekday and time.
I use this permission:
But when i use exactAllowWhileIdle i got this error:
When i use inexactAllowWhileIdle the alarm just not working.
The text was updated successfully, but these errors were encountered: