Skip to content

Commit 54f5555

Browse files
fix(firebase_messaging): Ensure onMessage callback is consistently called on iOS platform. (#8202)
1 parent 10746df commit 54f5555

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

packages/firebase_messaging/firebase_messaging/ios/Classes/FLTFirebaseMessagingPlugin.m

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -303,11 +303,7 @@ - (void)userNotificationCenter:(UNUserNotificationCenter *)center
303303
NSDictionary *notificationDict =
304304
[FLTFirebaseMessagingPlugin NSDictionaryFromUNNotification:notification];
305305

306-
// Don't send an event if contentAvailable is true - application:didReceiveRemoteNotification
307-
// will send the event for us, we don't want to duplicate them.
308-
if (!notificationDict[@"contentAvailable"]) {
309-
[_channel invokeMethod:@"Messaging#onMessage" arguments:notificationDict];
310-
}
306+
[_channel invokeMethod:@"Messaging#onMessage" arguments:notificationDict];
311307
}
312308

313309
// Forward on to any other delegates amd allow them to control presentation behavior.
@@ -490,7 +486,6 @@ - (BOOL)application:(UIApplication *)application
490486
}
491487
}];
492488
} else {
493-
[_channel invokeMethod:@"Messaging#onMessage" arguments:notificationDict];
494489
completionHandler(UIBackgroundFetchResultNoData);
495490
}
496491

0 commit comments

Comments
 (0)