react-native-macos 0.73.9 → 0.73.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/Libraries/AppDelegate/RCTAppDelegate.mm +5 -1
  2. package/Libraries/Core/ReactNativeVersion.js +1 -1
  3. package/Libraries/Image/RCTUIImageViewAnimated.mm +0 -5
  4. package/Libraries/Network/React-RCTNetwork.podspec +4 -1
  5. package/Libraries/PushNotificationIOS/RCTPushNotificationManager.h +2 -2
  6. package/Libraries/PushNotificationIOS/RCTPushNotificationManager.mm +9 -111
  7. package/Libraries/Text/React-RCTText.podspec +4 -1
  8. package/Libraries/Text/Text/RCTTextView.mm +7 -15
  9. package/Libraries/Text/TextInput/RCTBaseTextInputView.mm +2 -6
  10. package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.h +3 -0
  11. package/Libraries/Text/TextInput/Singleline/macOS/RCTUISecureTextField.m +2 -0
  12. package/React/Base/RCTConvert.m +2 -0
  13. package/React/Base/RCTKeyCommands.m +5 -1
  14. package/React/Base/RCTUtils.h +5 -0
  15. package/React/Base/RCTUtils.m +12 -0
  16. package/React/Base/RCTVersion.m +1 -1
  17. package/React/CoreModules/RCTDeviceInfo.mm +9 -9
  18. package/React/CoreModules/RCTPerfMonitor.mm +5 -1
  19. package/React/CoreModules/RCTRedBox.mm +6 -0
  20. package/React/CoreModules/RCTStatusBarManager.mm +50 -15
  21. package/React/CoreModules/React-CoreModules.podspec +1 -1
  22. package/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm +4 -0
  23. package/React/Fabric/Mounting/ComponentViews/Modal/RCTFabricModalHostViewController.mm +8 -0
  24. package/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm +6 -4
  25. package/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm +7 -15
  26. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm +3 -1
  27. package/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputUtils.mm +2 -2
  28. package/React/Fabric/RCTSurfacePointerHandler.mm +8 -1
  29. package/React/Fabric/RCTSurfaceTouchHandler.mm +4 -0
  30. package/React/Modules/RCTUIManager.m +4 -2
  31. package/React/React-RCTFabric.podspec +5 -2
  32. package/React/UIUtils/RCTUIUtils.m +21 -4
  33. package/React/Views/RCTModalHostView.m +2 -0
  34. package/React/Views/RCTModalHostViewController.m +8 -0
  35. package/React/Views/RCTWrapperViewController.m +2 -0
  36. package/React/Views/ScrollView/RCTScrollView.m +4 -0
  37. package/React/Views/ScrollView/RCTScrollViewManager.h +2 -0
  38. package/React/Views/ScrollView/RCTScrollViewManager.m +4 -2
  39. package/React-Core.podspec +1 -1
  40. package/ReactAndroid/gradle.properties +1 -1
  41. package/ReactAndroid/src/main/java/com/facebook/react/modules/systeminfo/ReactNativeVersion.java +1 -1
  42. package/ReactCommon/cxxreact/ReactNativeVersion.h +1 -1
  43. package/ReactCommon/react/nativemodule/samples/platform/ios/ReactCommon/RCTSampleTurboModule.mm +4 -0
  44. package/package.json +1 -1
@@ -129,7 +129,11 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
129
129
  rootView = [self createRootViewWithBridge:self.bridge moduleName:self.moduleName initProps:initProps];
130
130
  }
131
131
  #if !TARGET_OS_OSX // [macOS]
132
+ #if !TARGET_OS_VISION // [visionOS]
132
133
  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
134
+ #else
135
+ self.window = [[UIWindow alloc] initWithFrame:CGRectMake(0, 0, 1280, 720)];
136
+ #endif // [visionOS]
133
137
  UIViewController *rootViewController = [self createRootViewController];
134
138
  [self setRootView:rootView toRootViewController:rootViewController];
135
139
  self.window.rootViewController = rootViewController;
@@ -138,7 +142,7 @@ static NSString *const kRNConcurrentRoot = @"concurrentRoot";
138
142
 
139
143
  return YES;
140
144
  #else // [macOS
141
- NSRect frame = NSMakeRect(0,0,1024,768);
145
+ NSRect frame = NSMakeRect(0,0,1280,720);
142
146
  self.window = [[NSWindow alloc] initWithContentRect:NSZeroRect
143
147
  styleMask:NSWindowStyleMaskTitled | NSWindowStyleMaskResizable | NSWindowStyleMaskClosable | NSWindowStyleMaskMiniaturizable
144
148
  backing:NSBackingStoreBuffered
@@ -12,6 +12,6 @@
12
12
  exports.version = {
13
13
  major: 0,
14
14
  minor: 73,
15
- patch: 9,
15
+ patch: 11,
16
16
  prerelease: null,
17
17
  };
@@ -193,15 +193,10 @@ static NSUInteger RCTDeviceFreeMemory(void)
193
193
 
194
194
  - (void)displayDidRefresh:(CADisplayLink *)displayLink
195
195
  {
196
- #if TARGET_OS_UIKITFORMAC
197
- // TODO: `displayLink.frameInterval` is not available on UIKitForMac
198
- NSTimeInterval durationToNextRefresh = displayLink.duration;
199
- #else
200
196
  // displaylink.duration -- time interval between frames, assuming maximumFramesPerSecond
201
197
  // displayLink.preferredFramesPerSecond (>= iOS 10) -- Set to 30 for displayDidRefresh to be called at 30 fps
202
198
  // durationToNextRefresh -- Time interval to the next time displayDidRefresh is called
203
199
  NSTimeInterval durationToNextRefresh = displayLink.targetTimestamp - displayLink.timestamp;
204
- #endif
205
200
  NSUInteger totalFrameCount = self.totalFrameCount;
206
201
  NSUInteger currentFrameIndex = self.currentFrameIndex;
207
202
  NSUInteger nextFrameIndex = (currentFrameIndex + 1) % totalFrameCount;
@@ -42,7 +42,10 @@ Pod::Spec.new do |s|
42
42
  "CLANG_CXX_LANGUAGE_STANDARD" => "c++20",
43
43
  "HEADER_SEARCH_PATHS" => header_search_paths.join(' ')
44
44
  }
45
- s.ios.frameworks = "MobileCoreServices" # [macOS] Restrict to iOS
45
+ # [macOS MobileCoreServices Not available on macOS
46
+ s.ios.frameworks = "MobileCoreServices"
47
+ s.visionos.frameworks = "MobileCoreServices"
48
+ # macOS]
46
49
 
47
50
  s.dependency "RCT-Folly", folly_version
48
51
  s.dependency "RCTTypeSafety"
@@ -15,18 +15,18 @@ extern NSString *const RCTRemoteNotificationReceived;
15
15
  typedef void (^RCTRemoteNotificationCallback)(UIBackgroundFetchResult result);
16
16
  #endif // [macOS]
17
17
 
18
- #if !TARGET_OS_UIKITFORMAC
19
18
  + (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
20
19
  + (void)didReceiveRemoteNotification:(NSDictionary *)notification;
21
20
  #if !TARGET_OS_OSX // [macOS]
22
21
  + (void)didReceiveRemoteNotification:(NSDictionary *)notification
23
22
  fetchCompletionHandler:(RCTRemoteNotificationCallback)completionHandler;
23
+ #if TARGET_OS_IOS // [visionOS]
24
24
  + (void)didReceiveLocalNotification:(UILocalNotification *)notification;
25
+ #endif // [visionOS]
25
26
  #endif // [macOS]
26
27
  #if TARGET_OS_OSX // [macOS
27
28
  + (void)didReceiveUserNotification:(NSUserNotification *)notification;
28
29
  #endif // macOS]
29
30
  + (void)didFailToRegisterForRemoteNotificationsWithError:(NSError *)error;
30
- #endif
31
31
 
32
32
  @end
@@ -24,8 +24,6 @@ static NSString *const kRemoteNotificationRegistrationFailed = @"RemoteNotificat
24
24
 
25
25
  static NSString *const kErrorUnableToRequestPermissions = @"E_UNABLE_TO_REQUEST_PERMISSIONS";
26
26
 
27
- #if !TARGET_OS_UIKITFORMAC
28
-
29
27
  @interface RCTPushNotificationManager () <NativePushNotificationManagerIOSSpec>
30
28
  @property (nonatomic, strong) NSMutableDictionary *remoteNotificationCallbacks;
31
29
  @end
@@ -97,16 +95,10 @@ RCT_ENUM_CONVERTER(
97
95
 
98
96
  @end
99
97
  #endif // [macOS]
100
- #else
101
- @interface RCTPushNotificationManager () <NativePushNotificationManagerIOSSpec>
102
- @end
103
- #endif // TARGET_OS_UIKITFORMAC
104
98
 
105
99
  @implementation RCTPushNotificationManager
106
100
 
107
- #if !TARGET_OS_UIKITFORMAC
108
-
109
- #if !TARGET_OS_OSX // [macOS]
101
+ #if TARGET_OS_IOS // [macOS] [visionOS]
110
102
  /** DEPRECATED. UILocalNotification was deprecated in iOS 10. Please don't add new callsites. */
111
103
  static NSDictionary *RCTFormatLocalNotification(UILocalNotification *notification)
112
104
  {
@@ -126,7 +118,8 @@ static NSDictionary *RCTFormatLocalNotification(UILocalNotification *notificatio
126
118
  formattedLocalNotification[@"remote"] = @NO;
127
119
  return formattedLocalNotification;
128
120
  }
129
- #else // [macOS
121
+ #endif // [macOS] [visionOS]
122
+ #if TARGET_OS_OSX // [macOS
130
123
  static NSDictionary *RCTFormatUserNotification(NSUserNotification *notification)
131
124
  {
132
125
  NSMutableDictionary *formattedUserNotification = [NSMutableDictionary dictionary];
@@ -198,8 +191,6 @@ static NSString *RCTFormatNotificationDateFromNSDate(NSDate *date)
198
191
  return [formatter stringFromDate:date];
199
192
  }
200
193
 
201
- #endif // TARGET_OS_UIKITFORMAC
202
-
203
194
  RCT_EXPORT_MODULE()
204
195
 
205
196
  - (dispatch_queue_t)methodQueue
@@ -207,7 +198,6 @@ RCT_EXPORT_MODULE()
207
198
  return dispatch_get_main_queue();
208
199
  }
209
200
 
210
- #if !TARGET_OS_UIKITFORMAC
211
201
  - (void)startObserving
212
202
  {
213
203
  [[NSNotificationCenter defaultCenter] addObserver:self
@@ -282,14 +272,15 @@ RCT_EXPORT_MODULE()
282
272
  }
283
273
  #endif // [macOS]
284
274
 
285
- #if !TARGET_OS_OSX // [macOS]
275
+ #if TARGET_OS_IOS // [macOS] [visionOS]
286
276
  + (void)didReceiveLocalNotification:(UILocalNotification *)notification
287
277
  {
288
278
  [[NSNotificationCenter defaultCenter] postNotificationName:kLocalNotificationReceived
289
279
  object:self
290
280
  userInfo:RCTFormatLocalNotification(notification)];
291
281
  }
292
- #else // [macOS
282
+ #endif // [macOS] [visionOS]
283
+ #if TARGET_OS_OSX // [macOS
293
284
  + (void)didReceiveUserNotification:(NSUserNotification *)notification
294
285
  {
295
286
  NSString *notificationName = notification.isRemote ? RCTRemoteNotificationReceived : kLocalNotificationReceived;
@@ -568,7 +559,7 @@ RCT_EXPORT_METHOD(getInitialNotification
568
559
  : (RCTPromiseResolveBlock)resolve reject
569
560
  : (__unused RCTPromiseRejectBlock)reject)
570
561
  {
571
- #if !TARGET_OS_OSX // [macOS]
562
+ #if TARGET_OS_IOS // [macOS] [visionOS]
572
563
  NSMutableDictionary<NSString *, id> *initialNotification =
573
564
  [self.bridge.launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey] mutableCopy];
574
565
 
@@ -583,7 +574,8 @@ RCT_EXPORT_METHOD(getInitialNotification
583
574
  } else {
584
575
  resolve((id)kCFNull);
585
576
  }
586
- #else // [macOS
577
+ #endif // [macOS] [visionOS]
578
+ #if TARGET_OS_OSX // [macOS
587
579
  NSUserNotification *initialNotification = self.bridge.launchOptions[NSApplicationLaunchUserNotificationKey];
588
580
  if (initialNotification) {
589
581
  resolve(RCTFormatUserNotification(initialNotification));
@@ -638,100 +630,6 @@ RCT_EXPORT_METHOD(getAuthorizationStatus : (RCTResponseSenderBlock)callback)
638
630
  }];
639
631
  }
640
632
 
641
- #else // TARGET_OS_UIKITFORMAC
642
-
643
- RCT_EXPORT_METHOD(onFinishRemoteNotification : (NSString *)notificationId fetchResult : (NSString *)fetchResult)
644
- {
645
- RCTLogError(@"Not implemented: %@", NSStringFromSelector(_cmd));
646
- }
647
-
648
- RCT_EXPORT_METHOD(setApplicationIconBadgeNumber : (double)number)
649
- {
650
- RCTLogError(@"Not implemented: %@", NSStringFromSelector(_cmd));
651
- }
652
-
653
- RCT_EXPORT_METHOD(getApplicationIconBadgeNumber : (RCTResponseSenderBlock)callback)
654
- {
655
- RCTLogError(@"Not implemented: %@", NSStringFromSelector(_cmd));
656
- }
657
-
658
- RCT_EXPORT_METHOD(requestPermissions
659
- : (JS::NativePushNotificationManagerIOS::SpecRequestPermissionsPermission &)permissions resolve
660
- : (RCTPromiseResolveBlock)resolve reject
661
- : (RCTPromiseRejectBlock)reject)
662
- {
663
- RCTLogError(@"Not implemented: %@", NSStringFromSelector(_cmd));
664
- }
665
-
666
- RCT_EXPORT_METHOD(abandonPermissions)
667
- {
668
- RCTLogError(@"Not implemented: %@", NSStringFromSelector(_cmd));
669
- }
670
-
671
- RCT_EXPORT_METHOD(checkPermissions : (RCTResponseSenderBlock)callback)
672
- {
673
- RCTLogError(@"Not implemented: %@", NSStringFromSelector(_cmd));
674
- }
675
-
676
- RCT_EXPORT_METHOD(presentLocalNotification : (JS::NativePushNotificationManagerIOS::Notification &)notification)
677
- {
678
- RCTLogError(@"Not implemented: %@", NSStringFromSelector(_cmd));
679
- }
680
-
681
- RCT_EXPORT_METHOD(scheduleLocalNotification : (JS::NativePushNotificationManagerIOS::Notification &)notification)
682
- {
683
- RCTLogError(@"Not implemented: %@", NSStringFromSelector(_cmd));
684
- }
685
-
686
- RCT_EXPORT_METHOD(cancelAllLocalNotifications)
687
- {
688
- RCTLogError(@"Not implemented: %@", NSStringFromSelector(_cmd));
689
- }
690
-
691
- RCT_EXPORT_METHOD(cancelLocalNotifications : (NSDictionary<NSString *, id> *)userInfo)
692
- {
693
- RCTLogError(@"Not implemented: %@", NSStringFromSelector(_cmd));
694
- }
695
-
696
- RCT_EXPORT_METHOD(getInitialNotification
697
- : (RCTPromiseResolveBlock)resolve reject
698
- : (__unused RCTPromiseRejectBlock)reject)
699
- {
700
- RCTLogError(@"Not implemented: %@", NSStringFromSelector(_cmd));
701
- }
702
-
703
- RCT_EXPORT_METHOD(getScheduledLocalNotifications : (RCTResponseSenderBlock)callback)
704
- {
705
- RCTLogError(@"Not implemented: %@", NSStringFromSelector(_cmd));
706
- }
707
-
708
- RCT_EXPORT_METHOD(removeAllDeliveredNotifications)
709
- {
710
- RCTLogError(@"Not implemented: %@", NSStringFromSelector(_cmd));
711
- }
712
-
713
- RCT_EXPORT_METHOD(removeDeliveredNotifications : (NSArray<NSString *> *)identifiers)
714
- {
715
- RCTLogError(@"Not implemented: %@", NSStringFromSelector(_cmd));
716
- }
717
-
718
- RCT_EXPORT_METHOD(getDeliveredNotifications : (RCTResponseSenderBlock)callback)
719
- {
720
- RCTLogError(@"Not implemented: %@", NSStringFromSelector(_cmd));
721
- }
722
-
723
- RCT_EXPORT_METHOD(getAuthorizationStatus : (RCTResponseSenderBlock)callback)
724
- {
725
- RCTLogError(@"Not implemented: %@", NSStringFromSelector(_cmd));
726
- }
727
-
728
- - (NSArray<NSString *> *)supportedEvents
729
- {
730
- return @[];
731
- }
732
-
733
- #endif // TARGET_OS_UIKITFORMAC
734
-
735
633
  - (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
736
634
  (const facebook::react::ObjCTurboModule::InitParams &)params
737
635
  {
@@ -30,7 +30,10 @@ Pod::Spec.new do |s|
30
30
  s.ios.exclude_files = "**/macOS/*" # [macOS]
31
31
  s.preserve_paths = "package.json", "LICENSE", "LICENSE-docs"
32
32
  s.header_dir = "RCTText"
33
- s.ios.framework = ["MobileCoreServices"] # [macOS] Restrict to iOS
33
+ # [macOS MobileCoreServices Not available on macOS
34
+ s.ios.frameworks = "MobileCoreServices"
35
+ s.visionos.frameworks = "MobileCoreServices"
36
+ # macOS]
34
37
  s.pod_target_xcconfig = { "CLANG_CXX_LANGUAGE_STANDARD" => "c++20" }
35
38
 
36
39
  s.dependency "Yoga"
@@ -373,29 +373,21 @@
373
373
 
374
374
  - (void)handleLongPress:(UILongPressGestureRecognizer *)gesture
375
375
  {
376
- #if !TARGET_OS_UIKITFORMAC
377
- if (@available(iOS 16.0, *)) {
376
+ if (@available(iOS 16.0, macCatalyst 16.0, *)) {
378
377
  CGPoint location = [gesture locationInView:self];
379
378
  UIEditMenuConfiguration *config = [UIEditMenuConfiguration configurationWithIdentifier:nil sourcePoint:location];
380
379
  if (_editMenuInteraction) {
381
380
  [_editMenuInteraction presentEditMenuWithConfiguration:config];
382
381
  }
383
- return;
384
- }
385
- // TODO: Adopt showMenuFromRect (necessary for UIKitForMac)
386
- UIMenuController *menuController = [UIMenuController sharedMenuController];
382
+ } else {
383
+ UIMenuController *menuController = [UIMenuController sharedMenuController];
387
384
 
388
- if (menuController.isMenuVisible) {
389
- return;
390
- }
385
+ if (menuController.isMenuVisible) {
386
+ return;
387
+ }
391
388
 
392
- if (!self.isFirstResponder) {
393
- [self becomeFirstResponder];
389
+ [menuController showMenuFromView:self rect:self.bounds];
394
390
  }
395
-
396
- [menuController setTargetRect:self.bounds inView:self];
397
- [menuController setMenuVisible:YES animated:YES];
398
- #endif
399
391
  }
400
392
  #else // [macOS
401
393
 
@@ -851,6 +851,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)decoder)
851
851
 
852
852
  #pragma mark - Custom Input Accessory View
853
853
 
854
+ #if TARGET_OS_IOS // [macOS] [visionOS]
854
855
  - (void)didSetProps:(NSArray<NSString *> *)changedProps
855
856
  {
856
857
  if ([changedProps containsObject:@"inputAccessoryViewID"] && self.inputAccessoryViewID) {
@@ -862,7 +863,6 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)decoder)
862
863
 
863
864
  - (void)setCustomInputAccessoryViewWithNativeID:(NSString *)nativeID
864
865
  {
865
- #if !TARGET_OS_OSX // [macOS]
866
866
  __weak RCTBaseTextInputView *weakSelf = self;
867
867
  [_bridge.uiManager rootViewForReactTag:self.reactTag
868
868
  withCompletion:^(UIView *rootView) {
@@ -877,12 +877,10 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)decoder)
877
877
  }
878
878
  }
879
879
  }];
880
- #endif // [macOS]
881
880
  }
882
881
 
883
882
  - (void)setDefaultInputAccessoryView
884
883
  {
885
- #if !TARGET_OS_OSX // [macOS]
886
884
  UIView<RCTBackedTextInputViewProtocol> *textInputView = self.backedTextInputView;
887
885
  UIKeyboardType keyboardType = textInputView.keyboardType;
888
886
 
@@ -914,10 +912,8 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)decoder)
914
912
  textInputView.inputAccessoryView = nil;
915
913
  }
916
914
  [self reloadInputViewsIfNecessary];
917
- #endif // [macOS]
918
915
  }
919
916
 
920
- #if !TARGET_OS_OSX // [macOS]
921
917
  - (void)reloadInputViewsIfNecessary
922
918
  {
923
919
  // We have to call `reloadInputViews` for focused text inputs to update an accessory view.
@@ -934,7 +930,7 @@ RCT_NOT_IMPLEMENTED(-(instancetype)initWithCoder : (NSCoder *)decoder)
934
930
  [self.backedTextInputView endEditing:YES];
935
931
  }
936
932
  }
937
- #endif // [macOS]
933
+ #endif // [macOS] [visionOS]
938
934
 
939
935
  // [macOS
940
936
 
@@ -7,6 +7,9 @@
7
7
 
8
8
  // [macOS]
9
9
 
10
+ #if TARGET_OS_OSX
10
11
  #define RCT_SUBCLASS_SECURETEXTFIELD 1
12
+ #endif
11
13
 
12
14
  #include <React/RCTUITextField.h>
15
+
@@ -7,6 +7,8 @@
7
7
 
8
8
  // [macOS]
9
9
 
10
+ #if TARGET_OS_OSX
10
11
  #define RCT_SUBCLASS_SECURETEXTFIELD 1
12
+ #endif
11
13
 
12
14
  #include "../RCTUITextField.mm"
@@ -555,8 +555,10 @@ RCT_ENUM_CONVERTER(
555
555
  (@{
556
556
  @"default" : @(UIBarStyleDefault),
557
557
  @"black" : @(UIBarStyleBlack),
558
+ #if !TARGET_OS_VISION // [visionOS]
558
559
  @"blackOpaque" : @(UIBarStyleBlackOpaque),
559
560
  @"blackTranslucent" : @(UIBarStyleBlackTranslucent),
561
+ #endif // [visionOS]
560
562
  }),
561
563
  UIBarStyleDefault,
562
564
  integerValue)
@@ -129,7 +129,11 @@ RCT_NOT_IMPLEMENTED(-(instancetype)init)
129
129
  isKeyDown = [event _isKeyDown];
130
130
  }
131
131
 
132
- BOOL interactionEnabled = !RCTSharedApplication().isIgnoringInteractionEvents;
132
+ #if !TARGET_OS_VISION // [visionOS]
133
+ BOOL interactionEnabled = !RCTSharedApplication().isIgnoringInteractionEvents;
134
+ #else // [visionOS
135
+ BOOL interactionEnabled = true;
136
+ #endif // visionOS]
133
137
  BOOL hasFirstResponder = NO;
134
138
  if (isKeyDown && modifiedInput.length > 0 && interactionEnabled) {
135
139
  UIResponder *firstResponder = nil;
@@ -99,6 +99,11 @@ RCT_EXTERN RCTUIApplication *__nullable RCTSharedApplication(void); // [macOS]
99
99
  // or view controller
100
100
  RCT_EXTERN RCTUIWindow *__nullable RCTKeyWindow(void); // [macOS]
101
101
 
102
+ #if TARGET_OS_VISION // [visionOS
103
+ // Returns UIStatusBarManager to get it's configuration info.
104
+ RCT_EXTERN UIStatusBarManager *__nullable RCTUIStatusBarManager(void);
105
+ #endif // visionOS]
106
+
102
107
  #if !TARGET_OS_OSX // [macOS]
103
108
  // Returns the presented view controller, useful if you need
104
109
  // e.g. to present a modal view controller or alert over it
@@ -352,7 +352,11 @@ CGSize RCTScreenSize(void)
352
352
  static dispatch_once_t onceToken;
353
353
  dispatch_once(&onceToken, ^{
354
354
  RCTUnsafeExecuteOnMainQueueSync(^{
355
+ #if TARGET_OS_IOS // [visionOS]
355
356
  size = [UIScreen mainScreen].bounds.size;
357
+ #else // [visionOS
358
+ size = RCTKeyWindow().bounds.size;
359
+ #endif // visionOS]
356
360
  });
357
361
  });
358
362
 
@@ -620,6 +624,14 @@ RCTUIWindow *__nullable RCTKeyWindow(void) // [macOS]
620
624
  #endif // macOS]
621
625
  }
622
626
 
627
+ #if TARGET_OS_VISION // [visionOS
628
+ UIStatusBarManager *__nullable RCTUIStatusBarManager(void) {
629
+ NSSet *connectedScenes = RCTSharedApplication().connectedScenes;
630
+ UIWindowScene *windowScene = [connectedScenes anyObject];
631
+ return windowScene.statusBarManager;
632
+ }
633
+ #endif // visionOS]
634
+
623
635
  #if !TARGET_OS_OSX // [macOS]
624
636
  UIViewController *__nullable RCTPresentedViewController(void)
625
637
  {
@@ -23,7 +23,7 @@ NSDictionary* RCTGetReactNativeVersion(void)
23
23
  __rnVersion = @{
24
24
  RCTVersionMajor: @(0),
25
25
  RCTVersionMinor: @(73),
26
- RCTVersionPatch: @(9),
26
+ RCTVersionPatch: @(11),
27
27
  RCTVersionPrerelease: [NSNull null],
28
28
  };
29
29
  });
@@ -56,27 +56,30 @@ RCT_EXPORT_MODULE()
56
56
  name:RCTAccessibilityManagerDidUpdateMultiplierNotification
57
57
  object:[_moduleRegistry moduleForName:"AccessibilityManager"]];
58
58
 
59
+ #if TARGET_OS_IOS // [visionOS]
59
60
  _currentInterfaceOrientation = [RCTSharedApplication() statusBarOrientation];
60
61
 
61
62
  [[NSNotificationCenter defaultCenter] addObserver:self
62
63
  selector:@selector(interfaceOrientationDidChange)
63
64
  name:UIApplicationDidChangeStatusBarOrientationNotification
64
65
  object:nil];
66
+ #endif // [visionOS]
65
67
  #endif // [macOS]
66
68
 
67
69
  _currentInterfaceDimensions = [self _exportedDimensions];
68
70
 
69
- #if !TARGET_OS_OSX // [macOS]
71
+ #if TARGET_OS_IOS // [macOS] [visionOS]
70
72
  [[NSNotificationCenter defaultCenter] addObserver:self
71
73
  selector:@selector(interfaceOrientationDidChange)
72
74
  name:UIApplicationDidBecomeActiveNotification
73
75
  object:nil];
76
+ #endif // [macOS] [visionOS]
74
77
 
75
78
  [[NSNotificationCenter defaultCenter] addObserver:self
76
79
  selector:@selector(interfaceFrameDidChange)
77
80
  name:RCTUserInterfaceStyleDidChangeNotification
78
81
  object:nil];
79
- #endif // [macOS]
82
+
80
83
  [[NSNotificationCenter defaultCenter] addObserver:self
81
84
  selector:@selector(interfaceFrameDidChange)
82
85
  name:RCTWindowFrameDidChangeNotification
@@ -90,8 +93,8 @@ RCT_EXPORT_MODULE()
90
93
 
91
94
  static BOOL RCTIsIPhoneNotched()
92
95
  {
93
- #if !TARGET_OS_OSX // [macOS]
94
96
  static BOOL isIPhoneNotched = NO;
97
+ #if TARGET_OS_IOS // [macOS] [visionOS]
95
98
  static dispatch_once_t onceToken;
96
99
 
97
100
  dispatch_once(&onceToken, ^{
@@ -100,11 +103,9 @@ static BOOL RCTIsIPhoneNotched()
100
103
  // 20pt is the top safeArea value in non-notched devices
101
104
  isIPhoneNotched = RCTSharedApplication().keyWindow.safeAreaInsets.top > 20;
102
105
  });
106
+ #endif // [macOS] [visionOS]
103
107
 
104
108
  return isIPhoneNotched;
105
- #else // [macOS
106
- return NO;
107
- #endif // macOS]
108
109
  }
109
110
 
110
111
 
@@ -182,8 +183,7 @@ static NSDictionary *RCTExportedDimensions(CGFloat fontScale)
182
183
  });
183
184
  }
184
185
 
185
- #if !TARGET_OS_OSX // [macOS]
186
-
186
+ #if TARGET_OS_IOS // [macOS] [visionOS]
187
187
  - (void)interfaceOrientationDidChange
188
188
  {
189
189
  __weak __typeof(self) weakSelf = self;
@@ -224,7 +224,7 @@ static NSDictionary *RCTExportedDimensions(CGFloat fontScale)
224
224
  #pragma clang diagnostic pop
225
225
  }
226
226
  }
227
- #endif // [macOS]
227
+ #endif // [macOS] [visionOS]
228
228
 
229
229
  - (void)interfaceFrameDidChange
230
230
  {
@@ -183,7 +183,11 @@ RCT_EXPORT_MODULE()
183
183
  - (UIView *)container
184
184
  {
185
185
  if (!_container) {
186
- CGSize statusBarSize = RCTSharedApplication().statusBarFrame.size;
186
+ #if !TARGET_OS_VISION // [visionOS]
187
+ CGSize statusBarSize = RCTSharedApplication().statusBarFrame.size;
188
+ #else // [visionOS
189
+ CGSize statusBarSize = RCTUIStatusBarManager().statusBarFrame.size;
190
+ #endif // visionOS]
187
191
  CGFloat statusBarHeight = statusBarSize.height;
188
192
  _container = [[UIView alloc] initWithFrame:CGRectMake(10, statusBarHeight, 180, RCTPerfMonitorBarHeight)];
189
193
  _container.layer.borderWidth = 2;
@@ -953,9 +953,15 @@ RCT_EXPORT_MODULE()
953
953
 
954
954
  if (!self->_window) {
955
955
  #if !TARGET_OS_OSX // [macOS]
956
+ #if !TARGET_OS_VISION // [macOS]
956
957
  self->_window = [[RCTRedBoxWindow alloc] initWithFrame:[UIScreen mainScreen].bounds
957
958
  customButtonTitles:self->_customButtonTitles
958
959
  customButtonHandlers:self->_customButtonHandlers];
960
+ #else // [visionOS
961
+ self->_window = [[RCTRedBoxWindow alloc] initWithFrame:CGRectMake(0, 0, 1280, 720)
962
+ customButtonTitles:self->_customButtonTitles
963
+ customButtonHandlers:self->_customButtonHandlers];
964
+ #endif // visionOS]
959
965
  #else // [macOS
960
966
  self->_window = [RCTRedBoxWindow new];
961
967
  #endif // macOS]