From 2b46b99f5c0a3ed6573d6482307b8fc645b33db6 Mon Sep 17 00:00:00 2001 From: Pedro Belo Date: Wed, 7 Dec 2016 11:25:19 -0800 Subject: [PATCH] note on info.plist setup with the -traditional flag otherwise the preprocessor will eat special characters from config vars in .env like "/". see: https://github.com/luggit/react-native-config/pull/53 --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5de0a4e..d799e94 100644 --- a/README.md +++ b/README.md @@ -71,11 +71,12 @@ NSString *apiUrl = [ReactNativeConfig envFor:@"API_URL"]; NSDictionary *config = [ReactNativeConfig env]; ``` -Read variables in your Info.plist by appending `__RN_CONFIG_` to the name: +They're also available for configuration in `Info.plist`, by appending `__RN_CONFIG_` to their name: ``` __RN_CONFIG_API_URL ``` + Note: Requires specific setup (see below) and a `Product > Clean` is required after changing the values to see the updated values. @@ -151,6 +152,7 @@ $ react-native link react-native-config * Search for "preprocess" * Set `Preprocess Info.plist File` to `Yes` * Set `Info.plist Preprocessor Prefix File` to `${CONFIGURATION_BUILD_DIR}/GeneratedInfoPlistDotEnv.h` +* Set `Info.plist Other Preprocessor Flags` to `-traditional` * If you don't see those settings, verify that "All" is selected at the top (instead of "Basic") ### Extra step for Android