numandev1 / react-native-keys

🔐 Protected .ENVs variables in React Native 🚀✨
MIT License
314 stars 28 forks source link

Use keys.dev.json instead? #78

Closed dayaki closed 4 months ago

dayaki commented 5 months ago

Thanks for this awesome package, I am just curious if it is possible to use my own naming convention for the json files? like keys.dev.json, keys.prod.json?

ngocle2497 commented 4 months ago

Thanks for this awesome package, I am just curious if it is possible to use my own naming convention for the json files? like keys.dev.json, keys.prod.json?

For android, u can use flavor. Or use

project.ext.keyFiles = [
debug: 'path to env',
release: 'path to env'
]

For ios, u can create new scheme to switch env file. Or use configuration to switch env:

if ["${CONFIGURATION}" = "Release"]; then
# load env for release
else
# load env for debug
fi
dayaki commented 4 months ago

awesome, got it to work.