Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture Environment Variable For IOS and Android #386

Closed
CharlesPereira1 opened this issue Dec 4, 2022 · 4 comments
Closed

Capture Environment Variable For IOS and Android #386

CharlesPereira1 opened this issue Dec 4, 2022 · 4 comments

Comments

@CharlesPereira1
Copy link

How do I capture the environment variable value and pass this info to the native IOS for dealings?

I know that in react-native-config it is possible to do:

// import header
#import "ReactNativeConfig.h"
// then read individual key like:
NSString *apiUrl = [ReactNativeConfig envFor:@"API_URL"];
// or just fetch the whole config
NSDictionary *config = [ReactNativeConfig env];

But would there be a way like this?

@github-actions
Copy link

github-actions bot commented Dec 4, 2022

Hey, thank you for opening this issue! 🙂 To boost priority on this issue and support open source please tip the team at https://issuehunt.io/r/goatandsheep/react-native-dotenv/issues/386

@goatandsheep
Copy link
Owner

Not that I know of unfortunately. This library is just a simple babel plugin for environment variables into JavaScript. If you know how to do it you're welcome to open a pr

@CharlesPereira1
Copy link
Author

I solved it by installing react-native-config thanks

@goatandsheep
Copy link
Owner

goatandsheep commented Dec 13, 2022

Yup react native config is more powerful in that it can access the custom iOS and Android components. The focus of this library is environment switching and simplicity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants