Attempt packager connection even when loaded from offline bundle

Reviewed By: bottledwalter

Differential Revision: D3446086

fbshipit-source-id: b6400cf9b1ec0b59bb53f94b306698359072fb7a
This commit is contained in:
Alex Kotliarskyi 2016-06-20 10:50:01 -07:00 committed by Facebook Github Bot 7
parent 662ec705cb
commit d26ce2e2c0
1 changed files with 3 additions and 2 deletions

View File

@ -239,11 +239,12 @@ RCT_EXPORT_MODULE()
- (NSURL *)packagerURL
{
NSString *host = [_bridge.bundleURL host];
NSString *scheme = [_bridge.bundleURL scheme];
if (!host) {
return nil;
host = @"localhost";
scheme = @"http";
}
NSString *scheme = [_bridge.bundleURL scheme];
NSNumber *port = [_bridge.bundleURL port];
if (!port) {
port = @8081; // Packager default port