You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. In XCode, in the project navigator, right click `Libraries` ➜ `Add Files to [your project's name]`
149
177
2. Go to `node_modules` ➜ `react-native-keys` and add `Keys.xcodeproj`
@@ -152,7 +180,58 @@ if cocoapods are used in the project then pod has to be installed as well:
152
180
5. And go the Build Settings tab. Make sure All is toggled on (instead of Basic)
153
181
6. Look for Header Search Paths and add `$(SRCROOT)/../node_modules/react-native-keys/ios/**` as `non-recursive`
154
182
155
-
- Manual Link (Android)
183
+
-**Mandatory Step**
184
+
185
+
With one extra step environment values can be exposed to "Info.plist" and Build settings in the native project.
186
+
187
+
1. click on the file tree and create new file of type XCConfig
188
+

189
+

190
+
2. save it under `ios` folder as "Config.xcconfig" with the following content:
191
+
192
+
```
193
+
#include? "tmp.xcconfig"
194
+
```
195
+
196
+
3. add the following to your ".gitignore":
197
+
198
+
```
199
+
ios/tmp.xcconfig
200
+
201
+
```
202
+
203
+
4. go to project settings
204
+
5. apply config to your configurations
205
+

206
+
6. Go to _Edit scheme..._ -> _Build_ -> _Pre-actions_, click _+_ and select _New Run Script Action_. Paste below code which will generate "tmp.xcconfig" before each build exposing values to Build Settings and Info.plist. Make sure to select your target under _Provide build settings from_, so `$SRCROOT` environment variables is available to the script..
7. You can now access your env variables in the Info.plist, for example `$(MY_ENV_VARIABLE)`. If you face issues accessing variables, please open a new issue and provide as much details as possible so above steps can be improved.
215
+
216
+
- Go to _Edit scheme..._ -> _Build_ -> _Pre-actions_, click _+_ and select _New Run Script Action_. Paste below code which will generate KEYS keys on native ios side (into node*modules) Make sure to select your target under \_Provide build settings from*, so `$SRCROOT` environment variables is available to the script.
With one extra step environment values can be exposed to "Info.plist" and Build settings in the native project.
269
-
270
-
1. click on the file tree and create new file of type XCConfig
271
-

272
-

273
-
2. save it under `ios` folder as "Config.xcconfig" with the following content:
274
-
275
-
```
276
-
#include? "tmp.xcconfig"
277
-
```
278
-
279
-
3. add the following to your ".gitignore":
280
-
281
-
```
282
-
ios/tmp.xcconfig
283
-
284
-
```
285
-
286
-
4. go to project settings
287
-
5. apply config to your configurations
288
-

289
-
6. Go to _Edit scheme..._ -> _Build_ -> _Pre-actions_, click _+_ and select _New Run Script Action_. Paste below code which will generate "tmp.xcconfig" before each build exposing values to Build Settings and Info.plist. Make sure to select your target under _Provide build settings from_, so `$SRCROOT` environment variables is available to the script..
7. You can now access your env variables in the Info.plist, for example `$(MY_ENV_VARIABLE)`. If you face issues accessing variables, please open a new issue and provide as much details as possible so above steps can be improved.
298
-
299
-
- Go to _Edit scheme..._ -> _Build_ -> _Pre-actions_, click _+_ and select _New Run Script Action_. Paste below code which will generate KEYS keys on native ios side (into node*modules) Make sure to select your target under \_Provide build settings from*, so `$SRCROOT` environment variables is available to the script.
@@ -335,17 +385,6 @@ The same environment variable can be used to assemble releases with a different
335
385
cd android && KEYSFILE=keys.staging.json ./gradlew assembleRelease
336
386
```
337
387
338
-
Alternatively, you can define a map in `build.gradle` associating builds with env files. Do it before the `apply from` call, and use build cases in lowercase, like:
In `android/app/build.gradle`, if you use `applicationIdSuffix` or `applicationId` that is different from the package name indicated in `AndroidManifest.xml` in `<manifest package="...">` tag, for example, to support different build variants:
0 commit comments