MaikuB / flutter_local_notifications

A Flutter plugin for displaying local notifications on Android, iOS, macOS and Linux
2.45k stars 1.39k forks source link

presentSound: false not working in iOS #2370

Closed InShad7 closed 1 month ago

InShad7 commented 2 months ago
 static Future<NotificationDetails> _notificationDetails(
  {Sound, channelName}) async {

 try {
   return NotificationDetails(
     android: AndroidNotificationDetails(
      "1$channelName",
      channelName,
      importance: Importance.high,
      priority: Priority.high,
      sound: RawResourceAndroidNotificationSound(Sound),
      enableVibration: true,
      playSound: true,
      groupAlertBehavior: GroupAlertBehavior.children,
    ),
    iOS: DarwinNotificationDetails(
      sound: '$Sound.wav',
      presentSound: false,
      presentAlert: true,
      presentBadge: true,
      presentBanner: true,
    ),
  );
} catch (e) {
  log('Error creating notification details: $e');
  return Future.error('Error creating notification details: $e');
}

}

it is working in foreground. but not in background and terminated state. In android working perfect but in iOS not.

MaikuB commented 1 month ago

This is working fine and could've been verified by modifying the example to schedule a notification to appear after the app has been terminated with the same details. You've most likely confused local notifications with push/remote notifications e.g. from Firebase Cloud Messaging