lugg / react-native-config

Bring some 12 factor love to your mobile apps!
MIT License
4.76k stars 652 forks source link

[Feature] Platform specific variables #757

Open ste7en opened 1 year ago

ste7en commented 1 year ago

A feature that can be useful is to support platform-specific secrets by prepending a platform prefix as ANDROID_ or IOS_, and later stripping them at build time in order to reference both variations with the same name. E.g.

ANDROID_API_KEY = my_android_key
IOS_API_KEY = my_ios_key
import Config from 'react-native-config'

const { API_KEY: apiKey } = Config;

PRs #753, #754, #755, #756 add this feature