From 916dde4c604b4bba0e510ee1ab5c0cf5bd19ecbe Mon Sep 17 00:00:00 2001 From: Phillip Pan Date: Tue, 20 Feb 2024 13:11:17 -0800 Subject: [PATCH] delete access to UIApplicationLaunchOptionsLocalNotificationKey (#43114) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/43114 Changelog: [iOS][Breaking] PR#42628 introduced new behavior on how the react native infra tracks local notifications that start the app. in this PR, we are officially deleting the old implementation. Reviewed By: ingridwang Differential Revision: D52931617 fbshipit-source-id: 3b77479b0aacf239e45cfcc7d7c4b20e82e0b786 --- .../RCTPushNotificationManager.mm | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm b/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm index 31b7dcb7a89296..d04a30cc5c681d 100644 --- a/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm +++ b/packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm @@ -565,27 +565,6 @@ - (void)handleRemoteNotificationRegistrationError:(NSNotification *)notification return; } - NSMutableDictionary *initialRemoteNotification = - [self.bridge.launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey] mutableCopy]; - - // The user actioned a remote notification to launch the app. This is a fallback that is deprecated - // in the new architecture. - if (initialRemoteNotification) { - initialRemoteNotification[@"remote"] = @YES; - resolve(initialRemoteNotification); - return; - } - - UILocalNotification *initialLocalNotification = - self.bridge.launchOptions[UIApplicationLaunchOptionsLocalNotificationKey]; - - // The user actioned a local notification to launch the app. Notification is represented by UILocalNotification. This - // is deprecated. - if (initialLocalNotification) { - resolve(RCTFormatLocalNotification(initialLocalNotification)); - return; - } - resolve((id)kCFNull); }