From 17d3f7c01edb6517cd6961726675ddba31e8273c Mon Sep 17 00:00:00 2001 From: Valentin REVERSAT Date: Mon, 22 Jan 2024 23:00:29 +0100 Subject: [PATCH] fix(notifications): add new Android permissions to use Notifications --- android/app/src/main/AndroidManifest.xml | 76 +++++++++++++++--------- lib/service/notification_service.dart | 6 +- 2 files changed, 52 insertions(+), 30 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index d060281a..f823ce54 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,9 +1,11 @@ + package="fr.vareversat.chabo"> - + + + @@ -14,45 +16,63 @@ - + + + + + + + + + + + + + + + + - - - + android:name=".MainActivity" + android:exported="true" + android:launchMode="singleTop" + android:theme="@style/LaunchTheme" + android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode" + android:hardwareAccelerated="true" + android:windowSoftInputMode="adjustResize"> + android:name="io.flutter.embedding.android.NormalTheme" + android:resource="@style/NormalTheme" /> - - + + + android:name="flutterEmbedding" + android:value="2" /> diff --git a/lib/service/notification_service.dart b/lib/service/notification_service.dart index 60941c6f..99ac3670 100644 --- a/lib/service/notification_service.dart +++ b/lib/service/notification_service.dart @@ -92,8 +92,10 @@ class NotificationService { localNotifications.resolvePlatformSpecificImplementation< AndroidFlutterLocalNotificationsPlugin>(); - return await androidImplementation?.requestNotificationsPermission() ?? - false; + return (await androidImplementation?.requestNotificationsPermission() ?? + false) && + (await androidImplementation?.requestExactAlarmsPermission() ?? + false); } return false;