Skip to content

Commit 56de923

Browse files
committed
fix: upstream sync ifdefs
1 parent 1b238f4 commit 56de923

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
@@ -110,48 +110,46 @@ - (void)applicationDidEnterBackground:(UIApplication *)application
110110
}
111111

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

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

154-
return rootView;
146+
[RCTComponentViewFactory currentComponentViewFactory].thirdPartyFabricComponentsProvider = self;
147+
}
148+
rootView = [self createRootViewWithBridge:self.bridge moduleName:moduleName initProps:initProps];
149+
150+
[self customizeRootView:(RCTRootView *)rootView];
151+
152+
return rootView;
155153
}
156154

157155
- (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)