Summary:
This PR adds initial support for Project Catalyst a.k.a. UIKitForMac. This is not yet meant for production, but this is enough for RNTester to successfully compile and mostly work :)

Some APIs are not supported on the Mac -- e.g. telephony, and deprecated APIs are removed on Mac ���-- those had to be ifdef'd out via platform checks.

The biggest limitation right now is that I couldn't get Web Socket code to successfully compile, and so there are a lot of temporary platform checks  for that , and the RCTWebSocket.xcodeproj is marked as not supporting UIKitForMac. Again -- temporary, until someone with more knowledge knows how to fix this.

https://github.com/react-native-community/discussions-and-proposals/issues/131

## Changelog

[iOS] [Added] - Fixed compilation for macOS (Project Catalyst) -- not meant for production use yet
Pull Request resolved: https://github.com/facebook/react-native/pull/25427

Test Plan:
- Open RNTester/RNTester.xcodeproj with Xcode 10.2, run it like a normal iOS app -- make sure it compiles and runs correctly (no regression)
- Open the same project with Xcode 11 beta 2 (or higher) on macOS Catalina beta, select "My Mac" as device target, and run -- see that it actually compiles and runs. **Note** there are unfortunately some required steps:
   - change build configuration to Release (because packager doesn't work correctly yet)
   - change development team to yours if Xcode tells you to
   - go to RNTester project → Build phases → Link binary with libraries, and change `platforms` for `libRCTWebSocket.a` to `iOS` (without Mac compatibility). I can't commit that change because it breaks compatibility with earlier Xcode versions

The two extra steps for successful compile will disappear once web socket compilation for Catalyst is fixed

Reviewed By: mmmulani

Differential Revision: D16088263

Pulled By: sammy-SC

fbshipit-source-id: 9c0b932b048e50a8e0f336eaa0612851b1909cae
This commit is contained in:
Radosław Pietruszewski 2019-07-04 10:27:03 -07:00 коммит произвёл Facebook Github Bot
Родитель 5dade01ca6
Коммит 3724810d21
22 изменённых файлов: 133 добавлений и 94 удалений

Просмотреть файл

@ -173,7 +173,12 @@ static NSUInteger RCTDeviceFreeMemory() {
- (void)displayDidRefresh:(CADisplayLink *)displayLink - (void)displayDidRefresh:(CADisplayLink *)displayLink
{ {
#if TARGET_OS_UIKITFORMAC
// TODO: `displayLink.frameInterval` is not available on UIKitForMac
NSTimeInterval duration = displayLink.duration;
#else
NSTimeInterval duration = displayLink.duration * displayLink.frameInterval; NSTimeInterval duration = displayLink.duration * displayLink.frameInterval;
#endif
NSUInteger totalFrameCount = self.totalFrameCount; NSUInteger totalFrameCount = self.totalFrameCount;
NSUInteger currentFrameIndex = self.currentFrameIndex; NSUInteger currentFrameIndex = self.currentFrameIndex;
NSUInteger nextFrameIndex = (currentFrameIndex + 1) % totalFrameCount; NSUInteger nextFrameIndex = (currentFrameIndex + 1) % totalFrameCount;

Просмотреть файл

@ -101,12 +101,15 @@ RCT_EXPORT_METHOD(openURL:(NSURL *)URL
} }
}]; }];
} else { } else {
#if !TARGET_OS_UIKITFORMAC
// Note: this branch will never be taken on UIKitForMac
BOOL opened = [RCTSharedApplication() openURL:URL]; BOOL opened = [RCTSharedApplication() openURL:URL];
if (opened) { if (opened) {
resolve(@YES); resolve(@YES);
} else { } else {
reject(RCTErrorUnspecified, [NSString stringWithFormat:@"Unable to open URL: %@", URL], nil); reject(RCTErrorUnspecified, [NSString stringWithFormat:@"Unable to open URL: %@", URL], nil);
} }
#endif
} }
} }
@ -170,12 +173,15 @@ RCT_EXPORT_METHOD(openSettings:(RCTPromiseResolveBlock)resolve
} }
}]; }];
} else { } else {
#if !TARGET_OS_UIKITFORMAC
// Note: This branch will never be taken on UIKitForMac
BOOL opened = [RCTSharedApplication() openURL:url]; BOOL opened = [RCTSharedApplication() openURL:url];
if (opened) { if (opened) {
resolve(nil); resolve(nil);
} else { } else {
reject(RCTErrorUnspecified, @"Unable to open app settings", nil); reject(RCTErrorUnspecified, @"Unable to open app settings", nil);
} }
#endif
} }
} }

Просмотреть файл

@ -7,7 +7,7 @@
#import "RCTNetInfo.h" #import "RCTNetInfo.h"
#if !TARGET_OS_TV #if !TARGET_OS_TV && !TARGET_OS_UIKITFORMAC
#import <CoreTelephony/CTTelephonyNetworkInfo.h> #import <CoreTelephony/CTTelephonyNetworkInfo.h>
#endif #endif
#import <React/RCTAssert.h> #import <React/RCTAssert.h>
@ -148,7 +148,7 @@ static void RCTReachabilityCallback(__unused SCNetworkReachabilityRef target, SC
status = RCTReachabilityStateNone; status = RCTReachabilityStateNone;
} }
#if !TARGET_OS_TV #if !TARGET_OS_TV && !TARGET_OS_UIKITFORMAC
else if ((flags & kSCNetworkReachabilityFlagsIsWWAN) != 0) { else if ((flags & kSCNetworkReachabilityFlagsIsWWAN) != 0) {
connectionType = RCTConnectionTypeCellular; connectionType = RCTConnectionTypeCellular;

Просмотреть файл

@ -13,7 +13,7 @@ extern NSString *const RCTRemoteNotificationReceived;
typedef void (^RCTRemoteNotificationCallback)(UIBackgroundFetchResult result); typedef void (^RCTRemoteNotificationCallback)(UIBackgroundFetchResult result);
#if !TARGET_OS_TV #if !TARGET_OS_TV && !TARGET_OS_UIKITFORMAC
+ (void)didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings; + (void)didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings;
+ (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken; + (void)didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken;
+ (void)didReceiveRemoteNotification:(NSDictionary *)notification; + (void)didReceiveRemoteNotification:(NSDictionary *)notification;

Просмотреть файл

@ -23,7 +23,7 @@ static NSString *const kRemoteNotificationRegistrationFailed = @"RemoteNotificat
static NSString *const kErrorUnableToRequestPermissions = @"E_UNABLE_TO_REQUEST_PERMISSIONS"; static NSString *const kErrorUnableToRequestPermissions = @"E_UNABLE_TO_REQUEST_PERMISSIONS";
#if !TARGET_OS_TV #if !TARGET_OS_TV && !TARGET_OS_UIKITFORMAC
@implementation RCTConvert (NSCalendarUnit) @implementation RCTConvert (NSCalendarUnit)
RCT_ENUM_CONVERTER(NSCalendarUnit, RCT_ENUM_CONVERTER(NSCalendarUnit,
@ -74,14 +74,14 @@ RCT_ENUM_CONVERTER(UIBackgroundFetchResult, (@{
}), UIBackgroundFetchResultNoData, integerValue) }), UIBackgroundFetchResultNoData, integerValue)
@end @end
#endif //TARGET_OS_TV #endif //TARGET_OS_TV / TARGET_OS_UIKITFORMAC
@implementation RCTPushNotificationManager @implementation RCTPushNotificationManager
{ {
RCTPromiseResolveBlock _requestPermissionsResolveBlock; RCTPromiseResolveBlock _requestPermissionsResolveBlock;
} }
#if !TARGET_OS_TV #if !TARGET_OS_TV && !TARGET_OS_UIKITFORMAC
static NSDictionary *RCTFormatLocalNotification(UILocalNotification *notification) static NSDictionary *RCTFormatLocalNotification(UILocalNotification *notification)
{ {
@ -125,7 +125,7 @@ static NSDictionary *RCTFormatUNNotification(UNNotification *notification)
return formattedNotification; return formattedNotification;
} }
#endif //TARGET_OS_TV #endif //TARGET_OS_TV / TARGET_OS_UIKITFORMAC
RCT_EXPORT_MODULE() RCT_EXPORT_MODULE()
@ -134,7 +134,7 @@ RCT_EXPORT_MODULE()
return dispatch_get_main_queue(); return dispatch_get_main_queue();
} }
#if !TARGET_OS_TV #if !TARGET_OS_TV && !TARGET_OS_UIKITFORMAC
- (void)startObserving - (void)startObserving
{ {
[[NSNotificationCenter defaultCenter] addObserver:self [[NSNotificationCenter defaultCenter] addObserver:self
@ -464,13 +464,13 @@ RCT_EXPORT_METHOD(getDeliveredNotifications:(RCTResponseSenderBlock)callback)
} }
} }
#else //TARGET_OS_TV #else //TARGET_OS_TV / TARGET_OS_UIKITFORMAC
- (NSArray<NSString *> *)supportedEvents - (NSArray<NSString *> *)supportedEvents
{ {
return @[]; return @[];
} }
#endif //TARGET_OS_TV #endif //TARGET_OS_TV / TARGET_OS_UIKITFORMAC
@end @end

Просмотреть файл

@ -294,7 +294,8 @@
- (void)handleLongPress:(UILongPressGestureRecognizer *)gesture - (void)handleLongPress:(UILongPressGestureRecognizer *)gesture
{ {
#if !TARGET_OS_TV // TODO: Adopt showMenuFromRect (necessary for UIKitForMac)
#if !TARGET_OS_TV && !TARGET_OS_UIKITFORMAC
UIMenuController *menuController = [UIMenuController sharedMenuController]; UIMenuController *menuController = [UIMenuController sharedMenuController];
if (menuController.isMenuVisible) { if (menuController.isMenuVisible) {

Просмотреть файл

@ -14,6 +14,8 @@
// limitations under the License. // limitations under the License.
// //
#if !TARGET_OS_UIKITFORMAC
#import "RCTSRWebSocket.h" #import "RCTSRWebSocket.h"
#import <Availability.h> #import <Availability.h>
@ -1635,3 +1637,5 @@ static NSRunLoop *networkRunLoop = nil;
} }
@end @end
#endif

Просмотреть файл

@ -43,7 +43,6 @@
3C86DF7A1ADF695F0047B81A /* RCTWebSocketModule.h */, 3C86DF7A1ADF695F0047B81A /* RCTWebSocketModule.h */,
3C86DF7B1ADF695F0047B81A /* RCTWebSocketModule.m */, 3C86DF7B1ADF695F0047B81A /* RCTWebSocketModule.m */,
3C86DF471ADF2C930047B81A /* Products */, 3C86DF471ADF2C930047B81A /* Products */,
13526A501F362F7F0008EF00 /* Frameworks */,
); );
indentWidth = 2; indentWidth = 2;
sourceTree = "<group>"; sourceTree = "<group>";
@ -67,12 +66,10 @@
buildConfigurationList = 2D2A28901D9B049200D4039D /* Build configuration list for PBXNativeTarget "RCTWebSocket-tvOS" */; buildConfigurationList = 2D2A28901D9B049200D4039D /* Build configuration list for PBXNativeTarget "RCTWebSocket-tvOS" */;
buildPhases = ( buildPhases = (
2D2A28841D9B049200D4039D /* Sources */, 2D2A28841D9B049200D4039D /* Sources */,
2DC5E5151F3A6C39000EE84B /* Frameworks */,
); );
buildRules = ( buildRules = (
); );
dependencies = ( dependencies = (
3DBE0D111F3B184D0099AA32 /* PBXTargetDependency */,
); );
name = "RCTWebSocket-tvOS"; name = "RCTWebSocket-tvOS";
productName = "RCTWebSocket-tvOS"; productName = "RCTWebSocket-tvOS";
@ -84,12 +81,10 @@
buildConfigurationList = 3C86DF5A1ADF2C930047B81A /* Build configuration list for PBXNativeTarget "RCTWebSocket" */; buildConfigurationList = 3C86DF5A1ADF2C930047B81A /* Build configuration list for PBXNativeTarget "RCTWebSocket" */;
buildPhases = ( buildPhases = (
3C86DF421ADF2C930047B81A /* Sources */, 3C86DF421ADF2C930047B81A /* Sources */,
13526A4F1F362F770008EF00 /* Frameworks */,
); );
buildRules = ( buildRules = (
); );
dependencies = ( dependencies = (
3DBE0D0F1F3B18490099AA32 /* PBXTargetDependency */,
); );
name = RCTWebSocket; name = RCTWebSocket;
productName = WebSocket; productName = WebSocket;
@ -119,6 +114,7 @@
developmentRegion = English; developmentRegion = English;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
knownRegions = ( knownRegions = (
English,
en, en,
); );
mainGroup = 3C86DF3D1ADF2C930047B81A; mainGroup = 3C86DF3D1ADF2C930047B81A;
@ -313,6 +309,7 @@
GCC_TREAT_WARNINGS_AS_ERRORS = NO; GCC_TREAT_WARNINGS_AS_ERRORS = NO;
OTHER_LDFLAGS = "-ObjC"; OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTS_UIKITFORMAC = NO;
}; };
name = Debug; name = Debug;
}; };
@ -324,56 +321,7 @@
GCC_TREAT_WARNINGS_AS_ERRORS = NO; GCC_TREAT_WARNINGS_AS_ERRORS = NO;
OTHER_LDFLAGS = "-ObjC"; OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
}; SUPPORTS_UIKITFORMAC = NO;
name = Release;
};
3DBE0CFE1F3B181A0099AA32 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
EXECUTABLE_PREFIX = lib;
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
};
3DBE0CFF1F3B181A0099AA32 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
EXECUTABLE_PREFIX = lib;
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
};
3DBE0D0B1F3B181C0099AA32 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_TESTABILITY = YES;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TVOS_DEPLOYMENT_TARGET = 9.2;
};
name = Debug;
};
3DBE0D0C1F3B181C0099AA32 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ANALYZER_NONNULL = YES;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_SUSPICIOUS_MOVES = YES;
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos;
TVOS_DEPLOYMENT_TARGET = 9.2;
}; };
name = Release; name = Release;
}; };

Просмотреть файл

@ -3,7 +3,7 @@
archiveVersion = 1; archiveVersion = 1;
classes = { classes = {
}; };
objectVersion = 46; objectVersion = 50;
objects = { objects = {
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
@ -537,6 +537,7 @@
6862DFCD2229DFCB00684E03 /* Screenshot.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Screenshot.h; sourceTree = "<group>"; }; 6862DFCD2229DFCB00684E03 /* Screenshot.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Screenshot.h; sourceTree = "<group>"; };
6862DFCE2229DFCC00684E03 /* Screenshot.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Screenshot.m; sourceTree = "<group>"; }; 6862DFCE2229DFCC00684E03 /* Screenshot.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Screenshot.m; sourceTree = "<group>"; };
68FF44371CF6111500720EFD /* RCTBundleURLProviderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTBundleURLProviderTests.m; sourceTree = "<group>"; }; 68FF44371CF6111500720EFD /* RCTBundleURLProviderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTBundleURLProviderTests.m; sourceTree = "<group>"; };
6E00598822C62D9E0037EC55 /* RNTester.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; name = RNTester.entitlements; path = RNTester/RNTester.entitlements; sourceTree = "<group>"; };
83636F8E1B53F22C009F943E /* RCTUIManagerScenarioTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUIManagerScenarioTests.m; sourceTree = "<group>"; }; 83636F8E1B53F22C009F943E /* RCTUIManagerScenarioTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTUIManagerScenarioTests.m; sourceTree = "<group>"; };
8385CEF41B873B5C00C6273E /* RCTImageLoaderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageLoaderTests.m; sourceTree = "<group>"; }; 8385CEF41B873B5C00C6273E /* RCTImageLoaderTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageLoaderTests.m; sourceTree = "<group>"; };
8385CF031B87479200C6273E /* RCTImageLoaderHelpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageLoaderHelpers.m; sourceTree = "<group>"; }; 8385CF031B87479200C6273E /* RCTImageLoaderHelpers.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RCTImageLoaderHelpers.m; sourceTree = "<group>"; };
@ -727,6 +728,7 @@
13B07FAE1A68108700A75B9A /* RNTester */ = { 13B07FAE1A68108700A75B9A /* RNTester */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
6E00598822C62D9E0037EC55 /* RNTester.entitlements */,
2DDEF00F1F84BF7B00DBDF73 /* Images.xcassets */, 2DDEF00F1F84BF7B00DBDF73 /* Images.xcassets */,
272E6B3A1BEA846C001FCF37 /* NativeExampleViews */, 272E6B3A1BEA846C001FCF37 /* NativeExampleViews */,
13B07FAF1A68108700A75B9A /* AppDelegate.h */, 13B07FAF1A68108700A75B9A /* AppDelegate.h */,
@ -1203,11 +1205,12 @@
}; };
3D13F83D1D6F6AE000E69E0E = { 3D13F83D1D6F6AE000E69E0E = {
CreatedOnToolsVersion = 7.3.1; CreatedOnToolsVersion = 7.3.1;
DevelopmentTeam = VYK7DLU38Z;
}; };
}; };
}; };
buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "RNTester" */; buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "RNTester" */;
compatibilityVersion = "Xcode 3.2"; compatibilityVersion = "Xcode 9.3";
developmentRegion = English; developmentRegion = English;
hasScannedForEncodings = 0; hasScannedForEncodings = 0;
knownRegions = ( knownRegions = (
@ -1822,7 +1825,11 @@
); );
INFOPLIST_FILE = RNTesterUnitTests/Info.plist; INFOPLIST_FILE = RNTesterUnitTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/RNTesterUnitTests", "$(PROJECT_DIR)/RNTesterUnitTests",
@ -1841,7 +1848,11 @@
); );
INFOPLIST_FILE = RNTesterUnitTests/Info.plist; INFOPLIST_FILE = RNTesterUnitTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/RNTesterUnitTests", "$(PROJECT_DIR)/RNTesterUnitTests",
@ -1856,6 +1867,9 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
BUNDLE_CONFIG = "$(SRCROOT)/../metro.config.js"; BUNDLE_CONFIG = "$(SRCROOT)/../metro.config.js";
CODE_SIGN_ENTITLEMENTS = RNTester/RNTester.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
DERIVE_UIKITFORMAC_PRODUCT_BUNDLE_IDENTIFIER = YES;
DEVELOPMENT_TEAM = VYK7DLU38Z; DEVELOPMENT_TEAM = VYK7DLU38Z;
GCC_PREPROCESSOR_DEFINITIONS = ( GCC_PREPROCESSOR_DEFINITIONS = (
"RN_BUNDLE_PREFIX=$(RN_BUNDLE_PREFIX)", "RN_BUNDLE_PREFIX=$(RN_BUNDLE_PREFIX)",
@ -1869,11 +1883,15 @@
); );
INFOPLIST_FILE = "$(SRCROOT)/RNTester/Info.plist"; INFOPLIST_FILE = "$(SRCROOT)/RNTester/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = "$(inherited)"; LIBRARY_SEARCH_PATHS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.react.uiapp; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.react.uiapp;
PRODUCT_NAME = RNTester; PRODUCT_NAME = RNTester;
RN_BUNDLE_PREFIX = ""; RN_BUNDLE_PREFIX = "";
SUPPORTS_UIKITFORMAC = YES;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
}; };
name = Debug; name = Debug;
@ -1883,6 +1901,9 @@
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
BUNDLE_CONFIG = "$(SRCROOT)/../metro.config.js"; BUNDLE_CONFIG = "$(SRCROOT)/../metro.config.js";
CODE_SIGN_ENTITLEMENTS = RNTester/RNTester.entitlements;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
DERIVE_UIKITFORMAC_PRODUCT_BUNDLE_IDENTIFIER = YES;
DEVELOPMENT_TEAM = VYK7DLU38Z; DEVELOPMENT_TEAM = VYK7DLU38Z;
GCC_PREPROCESSOR_DEFINITIONS = "RN_BUNDLE_PREFIX=$(RN_BUNDLE_PREFIX)"; GCC_PREPROCESSOR_DEFINITIONS = "RN_BUNDLE_PREFIX=$(RN_BUNDLE_PREFIX)";
HEADER_SEARCH_PATHS = ( HEADER_SEARCH_PATHS = (
@ -1892,10 +1913,14 @@
); );
INFOPLIST_FILE = "$(SRCROOT)/RNTester/Info.plist"; INFOPLIST_FILE = "$(SRCROOT)/RNTester/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 9.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = "$(inherited)"; LIBRARY_SEARCH_PATHS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.react.uiapp; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.react.uiapp;
PRODUCT_NAME = RNTester; PRODUCT_NAME = RNTester;
SUPPORTS_UIKITFORMAC = YES;
TARGETED_DEVICE_FAMILY = "1,2"; TARGETED_DEVICE_FAMILY = "1,2";
}; };
name = Release; name = Release;
@ -1912,7 +1937,11 @@
); );
INFOPLIST_FILE = RNTesterIntegrationTests/Info.plist; INFOPLIST_FILE = RNTesterIntegrationTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.React.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.React.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RNTester.app/RNTester"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RNTester.app/RNTester";
@ -1928,7 +1957,11 @@
GCC_NO_COMMON_BLOCKS = YES; GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = RNTesterIntegrationTests/Info.plist; INFOPLIST_FILE = RNTesterIntegrationTests/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0; IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.React.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.React.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RNTester.app/RNTester"; TEST_HOST = "$(BUILT_PRODUCTS_DIR)/RNTester.app/RNTester";
@ -1949,7 +1982,11 @@
"FB_REFERENCE_IMAGE_DIR=\"\\\"$(SOURCE_ROOT)/$(PROJECT_NAME)IntegrationTests/ReferenceImages\\\"\"", "FB_REFERENCE_IMAGE_DIR=\"\\\"$(SOURCE_ROOT)/$(PROJECT_NAME)IntegrationTests/ReferenceImages\\\"\"",
); );
INFOPLIST_FILE = RNTesterIntegrationTests/Info.plist; INFOPLIST_FILE = RNTesterIntegrationTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/RNTesterUnitTests", "$(PROJECT_DIR)/RNTesterUnitTests",
@ -1973,7 +2010,11 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_NO_COMMON_BLOCKS = YES; GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = RNTesterIntegrationTests/Info.plist; INFOPLIST_FILE = RNTesterIntegrationTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/RNTesterUnitTests", "$(PROJECT_DIR)/RNTesterUnitTests",
@ -1996,7 +2037,10 @@
DEBUG_INFORMATION_FORMAT = dwarf; DEBUG_INFORMATION_FORMAT = dwarf;
GCC_NO_COMMON_BLOCKS = YES; GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "RNTester-tvOS/Info.plist"; INFOPLIST_FILE = "RNTester-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.RNTester-tvOS"; PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.RNTester-tvOS";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos; SDKROOT = appletvos;
@ -2016,7 +2060,10 @@
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
GCC_NO_COMMON_BLOCKS = YES; GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = "RNTester-tvOS/Info.plist"; INFOPLIST_FILE = "RNTester-tvOS/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.RNTester-tvOS"; PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.RNTester-tvOS";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = appletvos; SDKROOT = appletvos;
@ -2039,7 +2086,11 @@
"$(SRCROOT)/RNTesterUnitTests/**", "$(SRCROOT)/RNTesterUnitTests/**",
); );
INFOPLIST_FILE = RNTesterUnitTests/Info.plist; INFOPLIST_FILE = RNTesterUnitTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/RNTesterUnitTests", "$(PROJECT_DIR)/RNTesterUnitTests",
@ -2067,7 +2118,11 @@
"$(SRCROOT)/RNTesterUnitTests/**", "$(SRCROOT)/RNTesterUnitTests/**",
); );
INFOPLIST_FILE = RNTesterUnitTests/Info.plist; INFOPLIST_FILE = RNTesterUnitTests/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
"@loader_path/Frameworks",
);
LIBRARY_SEARCH_PATHS = ( LIBRARY_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"$(PROJECT_DIR)/RNTesterUnitTests", "$(PROJECT_DIR)/RNTesterUnitTests",
@ -2084,12 +2139,15 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
COMBINE_HIDPI_IMAGES = YES; COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = VYK7DLU38Z;
GCC_NO_COMMON_BLOCKS = YES; GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = RNTester/RNTesterBundle/Info.plist; INFOPLIST_FILE = RNTester/RNTesterBundle/Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.RNTesterBundle; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.RNTesterBundle;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = 1;
WRAPPER_EXTENSION = bundle; WRAPPER_EXTENSION = bundle;
}; };
name = Debug; name = Debug;
@ -2098,12 +2156,15 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
CLANG_ANALYZER_NONNULL = YES; CLANG_ANALYZER_NONNULL = YES;
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "-";
COMBINE_HIDPI_IMAGES = YES; COMBINE_HIDPI_IMAGES = YES;
DEVELOPMENT_TEAM = VYK7DLU38Z;
GCC_NO_COMMON_BLOCKS = YES; GCC_NO_COMMON_BLOCKS = YES;
INFOPLIST_FILE = RNTester/RNTesterBundle/Info.plist; INFOPLIST_FILE = RNTester/RNTesterBundle/Info.plist;
PRODUCT_BUNDLE_IDENTIFIER = com.facebook.RNTesterBundle; PRODUCT_BUNDLE_IDENTIFIER = com.facebook.RNTesterBundle;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos; SDKROOT = iphoneos;
TARGETED_DEVICE_FAMILY = 1;
WRAPPER_EXTENSION = bundle; WRAPPER_EXTENSION = bundle;
}; };
name = Release; name = Release;

Просмотреть файл

@ -18,7 +18,7 @@
#import <cxxreact/JSExecutor.h> #import <cxxreact/JSExecutor.h>
#if !TARGET_OS_TV #if !TARGET_OS_TV && !TARGET_OS_UIKITFORMAC
#import <React/RCTPushNotificationManager.h> #import <React/RCTPushNotificationManager.h>
#endif #endif
@ -160,7 +160,7 @@
# pragma mark - Push Notifications # pragma mark - Push Notifications
#if !TARGET_OS_TV #if !TARGET_OS_TV && !TARGET_OS_UIKITFORMAC
// Required to register for notifications // Required to register for notifications
- (void)application:(__unused UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings - (void)application:(__unused UIApplication *)application didRegisterUserNotificationSettings:(UIUserNotificationSettings *)notificationSettings

Просмотреть файл

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.personal-information.photos-library</key>
<true/>
</dict>
</plist>

Просмотреть файл

@ -286,7 +286,7 @@ RCT_NOT_IMPLEMENTED(- (instancetype)init)
- (void)reload - (void)reload
{ {
#if RCT_ENABLE_INSPECTOR #if RCT_ENABLE_INSPECTOR && !TARGET_OS_UIKITFORMAC
// Disable debugger to resume the JsVM & avoid thread locks while reloading // Disable debugger to resume the JsVM & avoid thread locks while reloading
[RCTInspectorDevServerHelper disableDebugger]; [RCTInspectorDevServerHelper disableDebugger];
#endif #endif

Просмотреть файл

@ -55,7 +55,7 @@
#endif #endif
#ifndef ENABLE_PACKAGER_CONNECTION #ifndef ENABLE_PACKAGER_CONNECTION
#if RCT_DEV && __has_include(<React/RCTPackagerConnection.h>) #if RCT_DEV && __has_include(<React/RCTPackagerConnection.h>) && !TARGET_OS_UIKITFORMAC
#define ENABLE_PACKAGER_CONNECTION 1 #define ENABLE_PACKAGER_CONNECTION 1
#else #else
#define ENABLE_PACKAGER_CONNECTION 0 #define ENABLE_PACKAGER_CONNECTION 0

Просмотреть файл

@ -241,7 +241,7 @@ RCT_EXPORT_MODULE()
if (devSettings.isNuclideDebuggingAvailable && !devSettings.isDebuggingRemotely) { if (devSettings.isNuclideDebuggingAvailable && !devSettings.isDebuggingRemotely) {
[items addObject:[RCTDevMenuItem buttonItemWithTitle:@"Debug with Nuclide" handler:^{ [items addObject:[RCTDevMenuItem buttonItemWithTitle:@"Debug with Nuclide" handler:^{
#if RCT_ENABLE_INSPECTOR #if RCT_ENABLE_INSPECTOR && !TARGET_OS_UIKITFORMAC
[RCTInspectorDevServerHelper attachDebugger:@"ReactNative" withBundleURL:bridge.bundleURL withView: RCTPresentedViewController()]; [RCTInspectorDevServerHelper attachDebugger:@"ReactNative" withBundleURL:bridge.bundleURL withView: RCTPresentedViewController()];
#endif #endif
}]]; }]];

Просмотреть файл

@ -9,7 +9,7 @@
#import <React/RCTDefines.h> #import <React/RCTDefines.h>
#import <React/RCTInspectorPackagerConnection.h> #import <React/RCTInspectorPackagerConnection.h>
#if RCT_DEV #if RCT_DEV && !TARGET_OS_UIKITFORMAC
@interface RCTInspectorDevServerHelper : NSObject @interface RCTInspectorDevServerHelper : NSObject

Просмотреть файл

@ -5,7 +5,7 @@
#import "RCTInspectorDevServerHelper.h" #import "RCTInspectorDevServerHelper.h"
#if RCT_DEV #if RCT_DEV && !TARGET_OS_UIKITFORMAC
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import <React/RCTLog.h> #import <React/RCTLog.h>

Просмотреть файл

@ -9,7 +9,7 @@
#import <React/RCTDefines.h> #import <React/RCTDefines.h>
#if RCT_DEV #if RCT_DEV && !TARGET_OS_UIKITFORMAC
NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_BEGIN

Просмотреть файл

@ -19,10 +19,12 @@
#import <React/RCTLog.h> #import <React/RCTLog.h>
#import <React/RCTPackagerClient.h> #import <React/RCTPackagerClient.h>
#import <React/RCTReconnectingWebSocket.h> #import <React/RCTReconnectingWebSocket.h>
#import <React/RCTSRWebSocket.h>
#import <React/RCTUtils.h> #import <React/RCTUtils.h>
#if RCT_DEV #if RCT_DEV && !TARGET_OS_UIKITFORMAC
#import <React/RCTSRWebSocket.h>
@interface RCTPackagerConnection () <RCTReconnectingWebSocketDelegate> @interface RCTPackagerConnection () <RCTReconnectingWebSocketDelegate>
@end @end

Просмотреть файл

@ -5,7 +5,7 @@
#import "RCTInspector.h" #import "RCTInspector.h"
#if RCT_DEV #if RCT_DEV && !TARGET_OS_UIKITFORMAC
#include <jsinspector/InspectorInterfaces.h> #include <jsinspector/InspectorInterfaces.h>

Просмотреть файл

@ -6,7 +6,7 @@
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
#import <React/RCTDefines.h> #import <React/RCTDefines.h>
#if RCT_DEV #if RCT_DEV && !TARGET_OS_UIKITFORMAC
@interface RCTBundleStatus : NSObject @interface RCTBundleStatus : NSObject
@property (atomic, assign) BOOL isLastBundleDownloadSuccess; @property (atomic, assign) BOOL isLastBundleDownloadSuccess;

Просмотреть файл

@ -5,7 +5,7 @@
#import "RCTInspectorPackagerConnection.h" #import "RCTInspectorPackagerConnection.h"
#if RCT_DEV #if RCT_DEV && !TARGET_OS_UIKITFORMAC
#import "RCTDefines.h" #import "RCTDefines.h"
#import "RCTInspector.h" #import "RCTInspector.h"

Просмотреть файл

@ -173,7 +173,7 @@ RCT_EXPORT_MODULE()
forMethod:@"reload"]; forMethod:@"reload"];
#endif #endif
#if RCT_ENABLE_INSPECTOR #if RCT_ENABLE_INSPECTOR && !TARGET_OS_UIKITFORMAC
// we need this dispatch back to the main thread because even though this // we need this dispatch back to the main thread because even though this
// is executed on the main thread, at this point the bridge is not yet // is executed on the main thread, at this point the bridge is not yet
// finished with its initialisation. But it does finish by the time it // finished with its initialisation. But it does finish by the time it