0.0.25 • Published 3 years ago

react-native-environmental v0.0.25

Weekly downloads
98
License
MIT
Repository
github
Last release
3 years ago

react-native-environmental

Less intrussive tool to manage many environment variables accross any part in a React Native Project.

Installation

npm install react-native-environmental

Usage

add .env's (.env.) android add apply apply from: "../../node_modules/react-native-environmental/android/preCompile.gradle"; initialize() add flavor and name it reference to .env variables from gradle project.env.get("") EXAMPLE: resValue "string", "", project.env.get("") NOTE: if you want to use an env data inside a string resource you have to delete it from the stringd.xml. for example if you want to replace the app_name, before build you have to remove from app/res/stringd.xml the line ZankyouMobileApp

reference to .env variables from code
	BuildConfig.<env var>

ios create Config.xcconfig create new scheme

	point, on every step, "Build Configuration" to "Config"
	preaction build
		set 'Provide build setting from' with the current target
		. "${SRCROOT}/../node_modules/react-native-environmental/ios/envCopy.sh" "<whatever>"
	postaction build
		set 'Provide build setting from' with the current target
		. "${SRCROOT}/../node_modules/react-native-environmental/ios/envCopyFinish.sh"

reference to .env variables from configuration
		${<env var>}
reference to .env variables from code
	[[[NSBundle mainBundle] objectForInfoDictionaryKey:@"ENV_VAR_<env var>"] UTF8String]

react-native run-android --variant=Debug --appIdSuffix '' react-native run-android --variant=Debug --appId '<appid_of_whatever>'

react-native run-ios --scheme ""

License

MIT

PRODUCT_BUNDLE_IDENTIFIERx

0.0.24

3 years ago

0.0.25

3 years ago

0.0.23

3 years ago

0.0.20

4 years ago

0.0.21

4 years ago

0.0.22

4 years ago

0.0.17

4 years ago

0.0.18

4 years ago

0.0.19

4 years ago

0.0.16

4 years ago

0.0.15

4 years ago

0.0.14

4 years ago

0.0.13

4 years ago

0.0.12

4 years ago

0.0.11

4 years ago

0.0.10

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.1

4 years ago

0.0.2

4 years ago

0.0.0

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.0

4 years ago