Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
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
36 changes: 34 additions & 2 deletions Examples/UIExplorer/UIExplorer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
147CED4C1AB3532B00DA3E4C /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 147CED4B1AB34F8C00DA3E4C /* libRCTActionSheet.a */; };
14AADF051AC3DBB1002390C9 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14AADF041AC3DB95002390C9 /* libReact.a */; };
14DC67F41AB71881001358AB /* libRCTPushNotification.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 14DC67F11AB71876001358AB /* libRCTPushNotification.a */; };
4CC372F91B23AD27004C3480 /* libReactWithoutPackager.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 4CC372F81B23AD27004C3480 /* libReactWithoutPackager.a */; };
58005BF21ABA80A60062E044 /* libRCTTest.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 58005BEE1ABA80530062E044 /* libRCTTest.a */; };
834C36EC1AF8DED70019C93C /* libRCTSettings.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 834C36D21AF8DA610019C93C /* libRCTSettings.a */; };
D85B829E1AB6D5D7003F4FE2 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = D85B829C1AB6D5CE003F4FE2 /* libRCTVibration.a */; };
Expand Down Expand Up @@ -98,6 +98,13 @@
remoteGlobalIDString = 134814201AA4EA6300B7C361;
remoteInfo = RCTPushNotification;
};
4CC372F71B23AD27004C3480 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 14AADEFF1AC3DB95002390C9 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 4C9E28471B23ABBC007E5DF4;
remoteInfo = ReactWithoutPackager;
};
58005BED1ABA80530062E044 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 58005BE41ABA80530062E044 /* RCTTest.xcodeproj */;
Expand Down Expand Up @@ -159,7 +166,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
14AADF051AC3DBB1002390C9 /* libReact.a in Frameworks */,
4CC372F91B23AD27004C3480 /* libReactWithoutPackager.a in Frameworks */,
147CED4C1AB3532B00DA3E4C /* libRCTActionSheet.a in Frameworks */,
134454601AAFCABD003F0779 /* libRCTAdSupport.a in Frameworks */,
134A8A2A1AACED7A00945AAE /* libRCTGeolocation.a in Frameworks */,
Expand Down Expand Up @@ -287,6 +294,7 @@
isa = PBXGroup;
children = (
14AADF041AC3DB95002390C9 /* libReact.a */,
4CC372F81B23AD27004C3480 /* libReactWithoutPackager.a */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -369,6 +377,7 @@
isa = PBXNativeTarget;
buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "UIExplorer" */;
buildPhases = (
4CC373051B23ADA4004C3480 /* ShellScript */,
13B07F871A680F5B00A75B9A /* Sources */,
13B07F8C1A680F5B00A75B9A /* Frameworks */,
13B07F8E1A680F5B00A75B9A /* Resources */,
Expand Down Expand Up @@ -530,6 +539,13 @@
remoteRef = 14DC67F01AB71876001358AB /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
4CC372F81B23AD27004C3480 /* libReactWithoutPackager.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libReactWithoutPackager.a;
remoteRef = 4CC372F71B23AD27004C3480 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
58005BEE1ABA80530062E044 /* libRCTTest.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
Expand Down Expand Up @@ -572,6 +588,22 @@
};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
4CC373051B23ADA4004C3480 /* ShellScript */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/bash;
shellScript = "export ORIGIN=$(/usr/libexec/PlistBuddy -c \"Print :RCTWebSocketExecutor:origin\" \"${INFOPLIST_FILE}\")\nexport PORT=$(/usr/libexec/PlistBuddy -c \"Print :RCTWebSocketExecutor:port\" \"${INFOPLIST_FILE}\")\n\nif nc -w 5 -z localhost $PORT ; then\n if ! curl -s \"${ORIGIN}:${PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\nelse\n # open w/t --args doesn't work:\n # open $SRCROOT/../../packager/launchPackager.command --args 111 222 || echo \"Can't start packager automatically\"\n osascript -e 'tell app \"Terminal\"\n do script \"'$SRCROOT'/../../packager/launchPackager.command --origin='${ORIGIN}' --port='${PORT}'\"\n end tell' || echo \"Can't start packager automatically\"\nfi";
};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
004D289A1AAF61C70097A701 /* Sources */ = {
isa = PBXSourcesBuildPhase;
Expand Down
18 changes: 17 additions & 1 deletion Examples/UIExplorer/UIExplorer/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,23 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
* on the same Wi-Fi network.
*/

jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/Examples/UIExplorer/UIExplorerApp.includeRequire.runModule.bundle?dev=true"];
NSMutableString* url;
NSDictionary *dict = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"RCTWebSocketExecutor"];
if( dict )
{
NSString* origin = [dict objectForKey:@"origin"];
NSString* port = [NSString stringWithFormat:@"%@", [dict objectForKey:@"port"]]; ;
url = [NSMutableString stringWithString:origin];
[url appendString:@":"];
[url appendString:port];
}
else
{
url = [NSMutableString stringWithString:@"http://localhost:8081"];
}
[url appendString:@"/Examples/UIExplorer/UIExplorerApp.includeRequire.runModule.bundle?dev=true"];

jsCodeLocation = [NSURL URLWithString:url];

/**
* OPTION 2
Expand Down
13 changes: 10 additions & 3 deletions Examples/UIExplorer/UIExplorer/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.facebook.internal.uiexplorer.local</string>
<string>com.facebook.$(PRODUCT_NAME:rfc1034identifier)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
Expand All @@ -22,8 +22,6 @@
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSLocationWhenInUseUsageDescription</key>
<string>You need to add NSLocationWhenInUseUsageDescription key in Info.plist to enable geolocation, otherwise it is going to *fail silently*!</string>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIRequiredDeviceCapabilities</key>
Expand All @@ -36,7 +34,16 @@
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>NSLocationWhenInUseUsageDescription</key>
<string>You need to add NSLocationWhenInUseUsageDescription key in Info.plist to enable geolocation, otherwise it is going to *fail silently*!</string>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>RCTWebSocketExecutor</key>
<dict>
<key>origin</key>
<string>http://localhost</string>
<key>port</key>
<integer>8086</integer>
</dict>
</dict>
</plist>
19 changes: 18 additions & 1 deletion Libraries/RCTTest/RCTTestRunner.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,24 @@ - (instancetype)initWithApp:(NSString *)app referenceDir:(NSString *)referenceDi
#if RUNNING_ON_CI
_scriptURL = [[NSBundle bundleForClass:[RCTBridge class]] URLForResource:@"main" withExtension:@"jsbundle"];
#else
_scriptURL = [NSURL URLWithString:[NSString stringWithFormat:@"http://localhost:8081/%@.includeRequire.runModule.bundle?dev=true", app]];

NSMutableString* url;
NSDictionary *dict = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"RCTWebSocketExecutor"];
if( dict )
{
NSString* origin = [dict objectForKey:@"origin"];
NSString* port = [NSString stringWithFormat:@"%@", [dict objectForKey:@"port"]]; ;
url = [NSMutableString stringWithString:origin];
[url appendString:@":"];
[url appendString:port];
}
else
{
url = [NSMutableString stringWithString:@"http://localhost:8081"];
}
[url appendString:[NSString stringWithFormat:@"/%@.includeRequire.runModule.bundle?dev=true", app]];

_scriptURL = [NSURL URLWithString:url];
#endif
}
return self;
Expand Down
18 changes: 17 additions & 1 deletion Libraries/WebSocket/RCTWebSocketExecutor.m
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,23 @@ @implementation RCTWebSocketExecutor

- (instancetype)init
{
return [self initWithURL:[NSURL URLWithString:@"http://localhost:8081/debugger-proxy"]];
NSMutableString* url;
NSDictionary *dict = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"RCTWebSocketExecutor"];
if( dict )
{
NSString* origin = [dict objectForKey:@"origin"];
NSString* port = [NSString stringWithFormat:@"%@", [dict objectForKey:@"port"]]; ;
url = [NSMutableString stringWithString:origin];
[url appendString:@":"];
[url appendString:port];
}
else
{
url = [NSMutableString stringWithString:@"http://localhost:8081"];
}
[url appendString:@"/debugger-proxy"];

return [self initWithURL:[NSURL URLWithString:url]];
}

- (instancetype)initWithURL:(NSURL *)URL
Expand Down
Loading