From d917387bb4f3e136e5b5425b57e9e6f82bd0cf1f Mon Sep 17 00:00:00 2001 From: "k.mannweiler" <2012491@stud.hs-mannheim.de> Date: Sat, 25 Feb 2023 14:19:55 +0100 Subject: [PATCH] Fixed IOS bug --- lib/service/notification_service.dart | 10 ++++++---- pubspec.lock | 2 +- pubspec.yaml | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/service/notification_service.dart b/lib/service/notification_service.dart index daff249..7eca521 100644 --- a/lib/service/notification_service.dart +++ b/lib/service/notification_service.dart @@ -21,8 +21,8 @@ class NotificationService { AndroidInitializationSettings('@mipmap/ic_launcher'); // ios initialization - const IOSInitializationSettings initializationSettingsIOS = - IOSInitializationSettings( + const DarwinInitializationSettings initializationSettingsIOS = + DarwinInitializationSettings( requestAlertPermission: false, requestBadgePermission: false, requestSoundPermission: false, @@ -33,7 +33,9 @@ class NotificationService { android: initializationSettingsAndroid, iOS: initializationSettingsIOS); // the initialization settings are initialized after they are setted - await flutterLocalNotificationsPlugin.initialize(initializationSettings); + bool? initialized = await flutterLocalNotificationsPlugin + .initialize(initializationSettings); + print(initialized); } Future setAllNotifications() async { @@ -63,7 +65,7 @@ class NotificationService { importance: Importance.max, priority: Priority.max), // iOS details - iOS: IOSNotificationDetails( + iOS: DarwinNotificationDetails( sound: 'default.wav', presentAlert: true, presentBadge: true, diff --git a/pubspec.lock b/pubspec.lock index 06d9416..b488967 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -412,7 +412,7 @@ packages: name: timezone url: "https://pub.dartlang.org" source: hosted - version: "0.8.0" + version: "0.9.1" typed_data: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 656fddc..8239b72 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -35,7 +35,7 @@ dependencies: # The following adds the Cupertino Icons font to your application. # Use with the CupertinoIcons class for iOS style icons. cupertino_icons: ^1.0.2 - timezone: ^0.8.0 + timezone: ^0.9.0 shared_preferences: ^2.0.17 audioplayers: ^3.0.1 mobile_scanner: ^3.0.0