diff --git a/React/Modules/RCTProcessInfo.h b/React/Modules/RCTProcessInfo.h new file mode 100644 index 00000000000..f4a501fbeee --- /dev/null +++ b/React/Modules/RCTProcessInfo.h @@ -0,0 +1,15 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import +#import + +@interface RCTProcessInfo : NSObject + +@end diff --git a/React/Modules/RCTProcessInfo.m b/React/Modules/RCTProcessInfo.m new file mode 100644 index 00000000000..bd15c2cf2c6 --- /dev/null +++ b/React/Modules/RCTProcessInfo.m @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2017-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + +#import "RCTProcessInfo.h" + +@implementation RCTProcessInfo + +RCT_EXPORT_MODULE() + +- (NSDictionary *)constantsToExport +{ + NSProcessInfo *processInfo = [NSProcessInfo processInfo]; + return + @{ + @"environment": processInfo.environment, + @"arguments": processInfo.arguments, + }; +} + +@end