From f712c20a437fdd075945a0009b7b1a87a9692ca5 Mon Sep 17 00:00:00 2001 From: Saad Najmi Date: Tue, 30 Jan 2024 07:36:48 -0800 Subject: [PATCH] [visionOS] Followup fixes (#2060) --- packages/react-native/Libraries/Text/React-RCTText.podspec | 1 + packages/react-native/React/CoreModules/RCTDeviceInfo.mm | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/react-native/Libraries/Text/React-RCTText.podspec b/packages/react-native/Libraries/Text/React-RCTText.podspec index 103e930b373440..0443c79b9dea3d 100644 --- a/packages/react-native/Libraries/Text/React-RCTText.podspec +++ b/packages/react-native/Libraries/Text/React-RCTText.podspec @@ -28,6 +28,7 @@ Pod::Spec.new do |s| s.source = source s.source_files = "**/*.{h,m,mm}" s.ios.exclude_files = "**/macOS/*" # [macOS] + s.visionos.exclude_files = "**/macOS/*" # [visionOS] s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs" s.header_dir = "RCTText" # [macOS MobileCoreServices Not available on macOS diff --git a/packages/react-native/React/CoreModules/RCTDeviceInfo.mm b/packages/react-native/React/CoreModules/RCTDeviceInfo.mm index 3a784faf3716aa..deade21a02bcd5 100644 --- a/packages/react-native/React/CoreModules/RCTDeviceInfo.mm +++ b/packages/react-native/React/CoreModules/RCTDeviceInfo.mm @@ -68,17 +68,18 @@ - (void)initialize _currentInterfaceDimensions = [self _exportedDimensions]; -#if !TARGET_OS_OSX // [macOS] +#if TARGET_OS_IOS // [macOS] [visionOS] [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(interfaceOrientationDidChange) name:UIApplicationDidBecomeActiveNotification object:nil]; +#endif // [macOS] [visionOS] [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(interfaceFrameDidChange) name:RCTUserInterfaceStyleDidChangeNotification object:nil]; -#endif // [macOS] + [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(interfaceFrameDidChange) name:RCTRootViewFrameDidChangeNotification