Skip to content

Conversation

@mthahzan
Copy link

feat: env library selection

This adds the flexibility of choosing between react-native-dotenv and react-native-config for env variables.

Screenshots

When not using ENV variables

Screenshot 2024-12-28 at 22 14 49

When using ENV variables

Screenshot 2024-12-28 at 22 10 28

package.json after selecting react-native-config

Screenshot 2024-12-28 at 22 13 06
@developer-sumit
Copy link
Owner

I was working on the same thing but you completed it before 😅.
Nice work 👍

@mthahzan
Copy link
Author

Cheers mate! Happy to help

@developer-sumit
Copy link
Owner

I still need time to verify these changes though. Like is it working properly in android as well or not.
If it's not working after building the app or maybe causes errors during app build then I might not accept this pull request.

I hope you can understand and thanks for your support 😊

@mthahzan
Copy link
Author

Yeah, let's verify before merging. If it needs any changes I can make them.

@developer-sumit
Copy link
Owner

You need to manually link the variables from the .env file in the native code to access them. I tried it myself, but it shows undefined.

It would be helpful if you could build the app on your end, log the values from the .env file to the console, and review the results. If you're able to make these changes, that would be great! However, if not, I can push my code. I've already implemented this feature, but due to my busy schedule, I haven’t been able to test it thoroughly.

@developer-sumit
Copy link
Owner

Are you able to fix the native code for this? I’m closing this PR as it's not working as expected. If you've made the necessary changes, please create a new PR with the updated code 😊. If you can't fix it, no worries—I’ve already made the updates, but I wanted to give you a chance to try. If it's not possible for you, I’ll push my code. There's still a chance your PR could get merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants