File tree Expand file tree Collapse file tree 2 files changed +7
-6
lines changed
lib/core/infrastructure/notification Expand file tree Collapse file tree 2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ part 'fcm_remote_message_providers.g.dart';
2121/// If the application is in the foreground, the Firebase SDK will block displaying any FCM notification
2222/// for android/iOS no matter what Notification Channel has been set. We can however still handle incoming notifications
2323/// via the onMessage stream and display a custom local notification using flutter_local_notifications.
24- /// Note: FCM can handle foreground for iOS by using `setForegroundNotificationPresentationOptions` but if you
25- /// want to use custom notification instead then avoid using it (or disable alert) as done in [_setupIOSHeadsUp] .
24+ /// Note: FCM can handle foreground for iOS by using `setForegroundNotificationPresentationOptions`
25+ /// but if you intend to use a custom notification, avoid using it to prevent duplicate heads-up notifications .
2626///
2727/// Using custom notification display for iOS in foreground is necessary to be able to
2828/// handle notification interaction using `onDidReceiveNotificationResponse` from flutter_local_notifications
Original file line number Diff line number Diff line change @@ -110,13 +110,14 @@ class NotificationService {
110110 }
111111
112112 /// Update the iOS foreground notification presentation options to allow heads up notifications.
113- /// Disable alert if you're using flutterLocalNotification to handle foreground notifications
114- /// instead of FCM, otherwise, you'll get duplicated heads up notification .
113+ /// Avoid this if you're using flutterLocalNotification to handle foreground notifications
114+ /// instead of FCM, otherwise, you'll receive duplicate heads- up notifications .
115115 Future <void > _setupIOSHeadsUp () async {
116- await FirebaseMessaging .instance.setForegroundNotificationPresentationOptions (
116+ /* await FirebaseMessaging.instance.setForegroundNotificationPresentationOptions(
117+ alert: true,
117118 sound: true,
118119 badge: true,
119- );
120+ ); */
120121 }
121122
122123 Future <AuthorizationStatus > _requestPermissions () async {
You can’t perform that action at this time.
0 commit comments