Skip to content

Commit

Permalink
Add android SCHEDULE_EXACT_ALARM permission
Browse files Browse the repository at this point in the history
  • Loading branch information
narumi147 committed Sep 30, 2024
1 parent 79e49bb commit 90ec2cd
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/deploy-github-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ jobs:
with:
distribution: 'temurin'
java-version: '17'
cache: 'gradle'

- name: Enable desktop support
if: matrix.target != 'android'
Expand Down
2 changes: 1 addition & 1 deletion android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<!-- flutter_local_notifications -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<!-- <uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" /> -->
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
<!-- <uses-permission android:name="android.permission.USE_EXACT_ALARM" /> -->

<!-- Android 10: android:requestLegacyExternalStorage="true" -->
Expand Down
3 changes: 2 additions & 1 deletion lib/utils/notification.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ abstract class LocalNotificationUtil {
} else if (Platform.isAndroid) {
final AndroidFlutterLocalNotificationsPlugin? androidImplementation =
plugin.resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>();
return androidImplementation?.requestNotificationsPermission();
await androidImplementation?.requestNotificationsPermission();
return androidImplementation?.requestExactAlarmsPermission();
}
return null;
}
Expand Down

0 comments on commit 90ec2cd

Please sign in to comment.