Skip to content

Instantly share code, notes, and snippets.

@Thunderbird7
Last active August 7, 2017 09:22
Show Gist options
  • Save Thunderbird7/73ec5e2325f8d76057890b9be9afa5d1 to your computer and use it in GitHub Desktop.
Save Thunderbird7/73ec5e2325f8d76057890b9be9afa5d1 to your computer and use it in GitHub Desktop.
// RNConfig.h
#import <React/RCTBridgeModule.h>
@interface RNConfig : NSObject<RCTBridgeModule>
@end
// RNConfig.m
#import "RNConfig.h"
#define kEnvironment "BuildEnvironment"
@implementation RNConfig
RCT_EXPORT_MODULE();
- (NSDictionary<NSString *,id> *)constantsToExport
{
NSDictionary *infoDict = [[NSBundle mainBundle] infoDictionary];
return @{@"buildEnvironment": infoDict[@kEnvironment]};
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment