Skip to content

Commit db97710

Browse files
author
Alejandro Caicedo
committed
feat: integrate react-native-config for environment variable management in Android
1 parent 658a195 commit db97710

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎android/app/build.gradle‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ apply plugin: "com.android.application"
22
apply plugin: "org.jetbrains.kotlin.android"
33
apply plugin: "com.facebook.react"
44

5+
// React Native Config
6+
apply from: project(':react-native-config').projectDir.getPath() + "/dotenv.gradle"
7+
58
// Only apply Google Services plugin if the google-services.json file exists
69
def googleServicesFile = file('google-services.json')
710
if (googleServicesFile.exists()) {
@@ -123,4 +126,7 @@ dependencies {
123126
} else {
124127
implementation jscFlavor
125128
}
129+
130+
// React Native Config
131+
implementation project(':react-native-config')
126132
}

‎android/settings.gradle‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@ extensions.configure(com.facebook.react.ReactSettingsExtension){ ex -> ex.autoli
44
rootProject.name = 'com.alejandrotechnology.rncatemplate'
55
include ':app'
66
includeBuild('../node_modules/@react-native/gradle-plugin')
7+
// React Native Config
8+
include ':react-native-config'
9+
project(':react-native-config').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-config/android')

0 commit comments

Comments
 (0)