RN: Packager URL defaults to port 8081 if no port in bundleURL
Summary:The packager url for the persistent connection relied on a port in the bundleURL, so we need to insert a sensible default. Otherwise, issues occur: https://github.com/facebook/react-native/issues/6581 Reviewed By: bestander Differential Revision: D3113034 fb-gh-sync-id: 4eac52631ad7abd343b75a4488bb591b5caf2145 fbshipit-source-id: 4eac52631ad7abd343b75a4488bb591b5caf2145
This commit is contained in:
parent
53355c692a
commit
ac534387f8
|
@ -239,6 +239,9 @@ RCT_EXPORT_MODULE()
|
||||||
|
|
||||||
NSString *scheme = [_bridge.bundleURL scheme];
|
NSString *scheme = [_bridge.bundleURL scheme];
|
||||||
NSNumber *port = [_bridge.bundleURL port];
|
NSNumber *port = [_bridge.bundleURL port];
|
||||||
|
if (!port) {
|
||||||
|
port = @8081; // Packager default port
|
||||||
|
}
|
||||||
return [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@:%@/message?role=shell", scheme, host, port]];
|
return [NSURL URLWithString:[NSString stringWithFormat:@"%@://%@:%@/message?role=shell", scheme, host, port]];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue