Fixed IOS bug

main
Kai Mannweiler 2023-02-25 14:19:55 +01:00
parent c0fbd35733
commit d917387bb4
3 changed files with 8 additions and 6 deletions

View File

@ -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<void> 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,

View File

@ -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:

View File

@ -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