Command line flags to start RN apps in web executor mode.

Reviewed By: frantic

Differential Revision: D2613142

fb-gh-sync-id: fadcea3d23825420c0412f2e4d8d51c70b0f08ed
This commit is contained in:
Natthu Bharambe
2015-11-06 14:52:43 -08:00
committed by facebook-github-bot-6
parent c4739746ba
commit cce9ba864f
2 changed files with 23 additions and 5 deletions

View File

@@ -39,7 +39,10 @@ RCT_EXPORT_MODULE()
- (instancetype)init
{
return [self initWithURL:[RCTConvert NSURL:@"http://localhost:8081/debugger-proxy"]];
NSUserDefaults *standardDefaults = [NSUserDefaults standardUserDefaults];
NSInteger port = [standardDefaults integerForKey:@"websocket-executor-port"] ?: 8081;
NSString *URLString = [NSString stringWithFormat:@"http://localhost:%zd/debugger-proxy", port];
return [self initWithURL:[RCTConvert NSURL:URLString]];
}
- (instancetype)initWithURL:(NSURL *)URL