Skip to content

Commit 46b54cc

Browse files
fix(firebase_messaging): Update notification key to NSApplicationLaunchUserNotificationKey for macOS. (#8251)
1 parent 2ac1263 commit 46b54cc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,13 @@ - (void)messaging:(nonnull FIRMessaging *)messaging
194194

195195
- (void)application_onDidFinishLaunchingNotification:(nonnull NSNotification *)notification {
196196
// Setup UIApplicationDelegate.
197+
#if TARGET_OS_OSX
198+
NSDictionary *remoteNotification =
199+
notification.userInfo[NSApplicationLaunchUserNotificationKey];
200+
#else
197201
NSDictionary *remoteNotification =
198202
notification.userInfo[UIApplicationLaunchOptionsRemoteNotificationKey];
203+
#endif
199204
if (remoteNotification != nil) {
200205
// If remoteNotification exists, it is the notification that opened the app.
201206
_initialNotification =

0 commit comments

Comments
 (0)