From 1266bf781c14ea48c6d342b7c025692b0f7b0653 Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Tue, 2 Jan 2024 11:31:15 -0800 Subject: [PATCH] RNTester iOS: Move Meta-internal setup to internal files (#42073) Summary: This moved various Meta-internal runtime setup off AppDelegate.mm to reduce the #if checks throughout the file. Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D52424748 --- .../Libraries/AppDelegate/RCTAppDelegate.mm | 5 ++++ packages/rn-tester/RNTester/AppDelegate.mm | 29 +++++++------------ 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm index 5ac436b606d7..c0065b727153 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm @@ -131,6 +131,11 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( return YES; } +- (void)applicationDidEnterBackground:(UIApplication *)application +{ + // Noop +} + - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge { [NSException raise:@"RCTBridgeDelegate::sourceURLForBridge not implemented" diff --git a/packages/rn-tester/RNTester/AppDelegate.mm b/packages/rn-tester/RNTester/AppDelegate.mm index bb72dbd41dd8..26168a3e4954 100644 --- a/packages/rn-tester/RNTester/AppDelegate.mm +++ b/packages/rn-tester/RNTester/AppDelegate.mm @@ -8,6 +8,7 @@ #import "AppDelegate.h" #import +#import #import #import #import @@ -21,26 +22,12 @@ #import #endif -// FB-internal imports -#ifdef RN_DISABLE_OSS_PLUGIN_HEADER -#import -#endif - -#if BUNDLE_PATH -NSString *kBundlePath = @"xplat/js/RKJSModules/EntryPoints/RNTesterBundle.js"; -#else -NSString *kBundlePath = @"js/RNTesterApp.ios"; -#endif +static NSString *kBundlePath = @"js/RNTesterApp.ios"; @implementation AppDelegate - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { -#ifdef RN_DISABLE_OSS_PLUGIN_HEADER - // FB-internal app init setup. - RCTFBAppInitApplicationDidFinishLaunching(launchOptions); -#endif - self.moduleName = @"RNTesterApp"; // You can add your custom initial props in the dictionary below. // They will be passed down to the ViewController used by React Native. @@ -51,10 +38,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( - (void)applicationDidEnterBackground:(UIApplication *)application { -#ifdef RN_DISABLE_OSS_PLUGIN_HEADER - // FB-internal app backgrounding setup. - RCTFBAppInitApplicationDidEnterBackground(application); -#endif + [super applicationDidEnterBackground:application]; } - (NSDictionary *)prepareInitialProps @@ -131,6 +115,13 @@ - (void)application:(__unused UIApplication *)application #endif +#pragma mark - New Arch Enabled settings + +- (BOOL)bridgelessEnabled +{ + return [super bridgelessEnabled]; +} + #pragma mark - RCTComponentViewFactoryComponentProvider #ifndef RN_DISABLE_OSS_PLUGIN_HEADER