Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
* LICENSE file in the root directory of this source tree.
*/

#import <TargetConditionals.h>
#if !TARGET_OS_OSX // [macOS]

#import <React/RCTLinkingManager.h>

#import <FBReactNativeSpec/FBReactNativeSpec.h>
Expand Down Expand Up @@ -205,3 +208,5 @@ Class RCTLinkingManagerCls(void)
{
return RCTLinkingManager.class;
}

#endif // !TARGET_OS_OSX [macOS]
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@

// [macOS]

#import "RCTLinkingManager.h"
#import <TargetConditionals.h>
#if TARGET_OS_OSX // [macOS]

#import <React/RCTLinkingManager.h>

#import <FBReactNativeSpec/FBReactNativeSpec.h>

#import <React/RCTBridge.h>
#import <React/RCTEventDispatcher.h>
#import <React/RCTLog.h>
#import <React/RCTUtils.h>

#import "RCTLinkingPlugins.h"
Expand All @@ -23,6 +27,9 @@
static BOOL moduleInitalized = NO;
static BOOL alwaysForegroundLastWindow = YES;

@interface RCTLinkingManager () <NativeLinkingManagerSpec>
@end

static void postNotificationWithURL(NSString *url, id sender)
{
NSDictionary<NSString *, id> *payload = @{@"url": url};
Expand Down Expand Up @@ -116,8 +123,34 @@ - (void)handleOpenURLNotification:(NSNotification *)notification
{
resolve(RCTNullIfNil(initialURL));
}

RCT_EXPORT_METHOD(openSettings:(RCTPromiseResolveBlock)resolve
reject:(__unused RCTPromiseRejectBlock)reject)
{
// macOS doesn't have a direct equivalent of UIApplicationOpenSettingsURLString
// Open System Preferences instead
[[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:@"x-apple.systempreferences:"]];
resolve(nil);
}

RCT_EXPORT_METHOD(sendIntent:(NSString *)action
extras:(NSArray *_Nullable)extras
resolve:(RCTPromiseResolveBlock)resolve
reject:(RCTPromiseRejectBlock)reject)
{
RCTLogError(@"Not implemented: %@", NSStringFromSelector(_cmd));
}

- (std::shared_ptr<facebook::react::TurboModule>)getTurboModule:
(const facebook::react::ObjCTurboModule::InitParams &)params
{
return std::make_shared<facebook::react::NativeLinkingManagerSpecJSI>(params);
}

@end

Class RCTLinkingManagerCls(void) {
return RCTLinkingManager.class;
}

#endif // TARGET_OS_OSX [macOS]
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,6 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &
needsInvalidateLayer = YES;
}

// `cursor`
if (oldViewProps.cursor != newViewProps.cursor) {
needsInvalidateLayer = YES;
}

// `shouldRasterize`
if (oldViewProps.shouldRasterize != newViewProps.shouldRasterize) {
self.layer.shouldRasterize = newViewProps.shouldRasterize;
Expand Down
3 changes: 3 additions & 0 deletions packages/react-native/React/Views/RCTCursor.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
// [macOS]

#import <Foundation/Foundation.h>
#if TARGET_OS_OSX // [macOS
#import <AppKit/AppKit.h>
#endif // macOS]
#import "RCTCursor.h"

#if defined(__MAC_OS_X_VERSION_MAX_ALLOWED) && __MAC_OS_X_VERSION_MAX_ALLOWED >= 150000 /* __MAC_15_0 */
Expand Down
Loading