mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix NativePlatformConstants
Summary: When in debug mode, PlatformConstants doesn't have a `ServerHost` constant. This wasn't captured by `NativePlatformConstants`. Changelog: [Android][Fixed] - Make sure ServerHost is optional in NativePlatformConstants.js Reviewed By: rickhanlonii Differential Revision: D19091270 fbshipit-source-id: 4b3ac73a4ab6111b3e433ecca01cc769e8cdec6b
This commit is contained in:
1 parent
38af48d5fd
commit
048f88a33a
4 files changed
+7
-6
No files matched your search
@@ -1976,7 +1976,7 @@ namespace JS {
|
||||
RCTRequired<NSString *> Serial;
|
||||
RCTRequired<NSString *> Fingerprint;
|
||||
RCTRequired<NSString *> Model;
|
||||
RCTRequired<NSString *> ServerHost;
|
||||
NSString *ServerHost;
|
||||
RCTRequired<NSString *> uiMode;
|
||||
};
|
||||
|
||||
@@ -3633,7 +3633,7 @@ inline JS::NativePlatformConstantsAndroid::Constants::Builder::Builder(const Inp
|
||||
d[@"Fingerprint"] = Fingerprint;
|
||||
auto Model = i.Model.get();
|
||||
d[@"Model"] = Model;
|
||||
auto ServerHost = i.ServerHost.get();
|
||||
auto ServerHost = i.ServerHost;
|
||||
d[@"ServerHost"] = ServerHost;
|
||||
auto uiMode = i.uiMode.get();
|
||||
d[@"uiMode"] = uiMode;
|
||||
|
||||
@@ -27,7 +27,7 @@ export interface Spec extends TurboModule {
|
||||
Serial: string,
|
||||
Fingerprint: string,
|
||||
Model: string,
|
||||
ServerHost: string,
|
||||
ServerHost?: string,
|
||||
uiMode: string,
|
||||
|};
|
||||
+getAndroidID: () => string;
|
||||
|
||||
@@ -38,7 +38,7 @@ const Platform = {
|
||||
Serial: string,
|
||||
Fingerprint: string,
|
||||
Model: string,
|
||||
ServerHost: string,
|
||||
ServerHost?: string,
|
||||
uiMode: string,
|
||||
|} {
|
||||
if (this.__constants == null) {
|
||||
|
||||
+3
-2
@@ -47,11 +47,12 @@ public abstract class NativePlatformConstantsAndroidSpec extends ReactContextBas
|
||||
"Version",
|
||||
"reactNativeVersion",
|
||||
"Model",
|
||||
"ServerHost",
|
||||
"isTesting",
|
||||
"Release"
|
||||
));
|
||||
Set<String> optionalFlowConstants = new HashSet<>();
|
||||
Set<String> optionalFlowConstants = new HashSet<>(Arrays.asList(
|
||||
"ServerHost"
|
||||
));
|
||||
Set<String> undeclaredConstants = new HashSet<>(constants.keySet());
|
||||
undeclaredConstants.removeAll(obligatoryFlowConstants);
|
||||
undeclaredConstants.removeAll(optionalFlowConstants);
|
||||
|
||||
Reference in new issue
Block a user