Dev-hwang / flutter_foreground_task

This plugin is used to implement a foreground service on the Android platform.
https://pub.dev/packages/flutter_foreground_task
MIT License
149 stars 109 forks source link

openAlarmsAndRemindersSettings android 14 #262

Closed BurtsevC closed 2 months ago

BurtsevC commented 2 months ago

I checked openAlarmsAndRemindersSettings in Android 12 it works as it is (added to Alarms and Reminders). But in Android 14 it's not added to list and window is not showing.

Dev-hwang commented 2 months ago

@BurtsevC

If the window does not appear, it means that the permission has been granted.

I confirmed that AlarmManager works well even without that app in the list.

I add a function to check whether permissions are granted before opening the window. I forgot 😅

Dev-hwang commented 2 months ago

@BurtsevC

released flutter_foreground_task: 8.5.0

      // Use this utility only if you provide services that require long-term survival,
      // such as exact alarm service, healthcare service, or Bluetooth communication.
      //
      // This utility requires the "android.permission.SCHEDULE_EXACT_ALARM" permission.
      // Using this permission may make app distribution difficult due to Google policy.
      if (!await FlutterForegroundTask.canScheduleExactAlarms) {
        await FlutterForegroundTask.openAlarmsAndRemindersSettings();
      }

There will be no problem if the user does not grant this permission. If permission is denied, the older version method is used.

BurtsevC commented 2 months ago

@Dev-hwang

Thanks a lot! Now it's clear))