From a79838630d2b4fb49f5410ba72aca43b4ade5914 Mon Sep 17 00:00:00 2001 From: w8385 Date: Fri, 11 Oct 2024 04:35:59 +0900 Subject: [PATCH] v2.2.0+80 --- android/app/src/main/AndroidManifest.xml | 12 ++++++------ lib/main.dart | 6 ++++++ packages/apis/notification_api/pubspec.yaml | 2 +- pubspec.yaml | 4 ++-- 4 files changed, 15 insertions(+), 9 deletions(-) diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index f275ee81..9e5f175e 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -37,7 +37,12 @@ - + + @@ -50,11 +55,6 @@ android:name="flutterEmbedding" android:value="2" /> - - diff --git a/lib/main.dart b/lib/main.dart index 33e39ae9..5eedd836 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -22,6 +22,11 @@ Future main() async { Future _initLocalNotification() async { FlutterLocalNotificationsPlugin localNotificationsPlugin = FlutterLocalNotificationsPlugin(); + localNotificationsPlugin + .resolvePlatformSpecificImplementation< + AndroidFlutterLocalNotificationsPlugin>() + ?.requestNotificationsPermission(); + AndroidInitializationSettings androidInitializationSettings = const AndroidInitializationSettings("mipmap/ic_launcher"); DarwinInitializationSettings iosInitializationSettings = @@ -30,6 +35,7 @@ Future _initLocalNotification() async { requestBadgePermission: false, requestSoundPermission: false, ); + InitializationSettings initializationSettings = InitializationSettings( android: androidInitializationSettings, iOS: iosInitializationSettings); await localNotificationsPlugin.initialize(initializationSettings); diff --git a/packages/apis/notification_api/pubspec.yaml b/packages/apis/notification_api/pubspec.yaml index 81a725a0..70ea5bb3 100644 --- a/packages/apis/notification_api/pubspec.yaml +++ b/packages/apis/notification_api/pubspec.yaml @@ -7,7 +7,7 @@ environment: sdk: '>=3.3.1 <4.0.0' dependencies: - flutter_local_notifications: ^13.0.0 + flutter_local_notifications: ^17.2.3 timezone: ^0.9.1 dev_dependencies: diff --git a/pubspec.yaml b/pubspec.yaml index 91c6f69b..b16e240c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ description: For solving problems in the world of programming; base on solved.ac publish_to: "none" # Remove this line if you wish to publish to pub.dev -version: 2.2.0+79 +version: 2.2.0+80 environment: sdk: ">=2.18.2 <3.0.0" @@ -17,7 +17,7 @@ dependencies: extended_image: ^8.1.0 fluttertoast: ^8.2.8 flutter_bloc: ^8.1.3 - flutter_local_notifications: ^13.0.0 + flutter_local_notifications: ^17.2.3 flutter_native_timezone: ^2.0.0 flutter_radar_chart: ^0.2.1 pie_chart: ^5.4.0