Skip to content

Commit 7f27967

Browse files
committed
fix: upstream sync ifdefs
1 parent ddc0df9 commit 7f27967

File tree

2 files changed

+38
-41
lines changed

2 files changed

+38
-41
lines changed

packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -105,48 +105,46 @@ - (void)applicationDidEnterBackground:(UIApplication *)application
105105
}
106106

107107
- (UIView *)viewWithModuleName:(NSString *)moduleName initialProperties:(NSDictionary*)initialProperties launchOptions:(NSDictionary*)launchOptions {
108-
BOOL fabricEnabled = self.fabricEnabled;
109-
BOOL enableBridgeless = self.bridgelessEnabled;
110-
111-
NSDictionary *initProps = updateInitialProps(initialProperties, fabricEnabled);
108+
BOOL fabricEnabled = self.fabricEnabled;
109+
BOOL enableBridgeless = self.bridgelessEnabled;
110+
111+
NSDictionary *initProps = updateInitialProps(initialProperties, fabricEnabled);
112+
113+
UIView *rootView;
114+
if (enableBridgeless) {
115+
// Enable native view config interop only if both bridgeless mode and Fabric is enabled.
116+
RCTSetUseNativeViewConfigsInBridgelessMode(self.fabricEnabled);
117+
118+
// Enable TurboModule interop by default in Bridgeless mode
119+
RCTEnableTurboModuleInterop(YES);
120+
RCTEnableTurboModuleInteropBridgeProxy(YES);
121+
122+
[self createReactHost];
123+
[RCTComponentViewFactory currentComponentViewFactory].thirdPartyFabricComponentsProvider = self;
124+
RCTFabricSurface *surface = [_reactHost createSurfaceWithModuleName:self.moduleName initialProperties:initProps];
125+
126+
RCTSurfaceHostingProxyRootView *surfaceHostingProxyRootView = [[RCTSurfaceHostingProxyRootView alloc]
127+
initWithSurface:surface
128+
sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact];
112129

113-
UIView *rootView;
114-
if (enableBridgeless) {
115-
// Enable native view config interop only if both bridgeless mode and Fabric is enabled.
116-
RCTSetUseNativeViewConfigsInBridgelessMode(self.fabricEnabled);
117-
118-
// Enable TurboModule interop by default in Bridgeless mode
119-
RCTEnableTurboModuleInterop(YES);
120-
RCTEnableTurboModuleInteropBridgeProxy(YES);
121-
122-
[self createReactHost];
123-
[RCTComponentViewFactory currentComponentViewFactory].thirdPartyFabricComponentsProvider = self;
124-
RCTFabricSurface *surface = [_reactHost createSurfaceWithModuleName:self.moduleName initialProperties:initProps];
125-
126-
RCTSurfaceHostingProxyRootView *surfaceHostingProxyRootView = [[RCTSurfaceHostingProxyRootView alloc]
127-
initWithSurface:surface
128-
sizeMeasureMode:RCTSurfaceSizeMeasureModeWidthExact | RCTSurfaceSizeMeasureModeHeightExact];
129-
130130
rootView = (RCTRootView *)surfaceHostingProxyRootView;
131131
rootView.backgroundColor = [UIColor systemBackgroundColor];
132-
} else {
133-
if (!self.bridge) {
134-
self.bridge = [self createBridgeWithDelegate:self launchOptions:launchOptions];
135-
}
136-
if ([self newArchEnabled]) {
137-
self.bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:self.bridge
138-
contextContainer:_contextContainer];
139-
self.bridge.surfacePresenter = self.bridgeAdapter.surfacePresenter;
140-
141-
[RCTComponentViewFactory currentComponentViewFactory].thirdPartyFabricComponentsProvider = self;
142-
}
143-
}
144-
rootView = [self createRootViewWithBridge:self.bridge moduleName:moduleName initProps:initProps];
145-
}
146-
147-
[self customizeRootView:(RCTRootView *)rootView];
132+
}
133+
if (!self.bridge) {
134+
self.bridge = [self createBridgeWithDelegate:self launchOptions:launchOptions];
135+
}
136+
if ([self newArchEnabled]) {
137+
self.bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:self.bridge
138+
contextContainer:_contextContainer];
139+
self.bridge.surfacePresenter = self.bridgeAdapter.surfacePresenter;
148140

149-
return rootView;
141+
[RCTComponentViewFactory currentComponentViewFactory].thirdPartyFabricComponentsProvider = self;
142+
}
143+
rootView = [self createRootViewWithBridge:self.bridge moduleName:moduleName initProps:initProps];
144+
145+
[self customizeRootView:(RCTRootView *)rootView];
146+
147+
return rootView;
150148
}
151149

152150
- (NSURL *)sourceURLForBridge:(RCTBridge *)bridge

packages/react-native/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -533,9 +533,7 @@ - (void)handleRemoteNotificationRegistrationError:(NSNotification *)notification
533533
: (RCTPromiseResolveBlock)resolve reject
534534
: (__unused RCTPromiseRejectBlock)reject)
535535
{
536-
#if TARGET_OS_VISION
537-
return;
538-
#endif
536+
#if !TARGET_OS_VISION
539537
// The user actioned a local or remote notification to launch the app. Notification is represented by UNNotification.
540538
// Set this property in the implementation of
541539
// userNotificationCenter:didReceiveNotificationResponse:withCompletionHandler.
@@ -574,6 +572,7 @@ - (void)handleRemoteNotificationRegistrationError:(NSNotification *)notification
574572
}
575573

576574
resolve((id)kCFNull);
575+
#endif
577576
}
578577

579578
RCT_EXPORT_METHOD(getScheduledLocalNotifications : (RCTResponseSenderBlock)callback)

0 commit comments

Comments
 (0)