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

ios undefined problem #800

Open
gkqkehs7 opened this issue May 3, 2024 · 9 comments
Open

ios undefined problem #800

gkqkehs7 opened this issue May 3, 2024 · 9 comments

Comments

@gkqkehs7
Copy link

gkqkehs7 commented May 3, 2024

I'm using react-native@0.73.5 and react-native-config@1.5.1,
And I had a problem with it coming up as undefined on iOS.
I downgraded react-native-config to 1.4.6 and it works successfully.

@gkqkehs7 gkqkehs7 changed the title ios undefined probleam ios undefined problem May 3, 2024
@anderskleve
Copy link

I had the same experience with v. 1.5.1 (react-native@0.73.3), where it wouldn't pick up the config values on iOS - it returned an empty object. Following the advice of @gkqkehs7 it now works!

@raza-jamil-reckon
Copy link

Upgrade from RN 0.71.1 to 0.74.1 and the config object stopped working. When I log it I can see that it has a getConstants function which gives the values when I run it but seems wrong. Tried different versions of react-native-config but no luck.

@GEMI
Copy link

GEMI commented May 24, 2024

No longer works after react-native upgrade to 0.74.1. Always returns undefined.

@ArturBuja
Copy link

ArturBuja commented Jul 11, 2024

I'm using:

 "react": "18.2.0",
    "react-native": "0.74.3",
    "react-native-config": "^1.5.2"

and import + using like this:

import Config from 'react-native-config';
console.log(Config.APP_NAME);

And everything works perfect for me.

@amerllica
Copy link
Contributor

I've got the same problem on Android.

@ovidiu-deliu
Copy link

@ArturBuja have you done some sort of manual linking or custom setup? How did you integrate the library on the project?

I am using:

"react": "18.2.0",
"react-native": "^0.73.5",
"react-native-config": "^1.5.3",

Still getting undefined on iOS.

@ArturBuja
Copy link

@ArturBuja have you done some sort of manual linking or custom setup? How did you integrate the library on the project?

I am using:

"react": "18.2.0", "react-native": "^0.73.5", "react-native-config": "^1.5.3",

Still getting undefined on iOS.

Just whole setup from docs.

  1. yarn add react-native-config && cd ios && pod install
    Whole this:
    https://github.com/lugg/react-native-config?tab=readme-ov-file#availability-in-build-settings-and-infoplist
    remember about this:
    Make sure the "Shared" checkbox is checked so the scheme is added to your version control system

There is a lot to setting in ios, also like in android so maybe you missed something. And if you have f.e. .env.stagging, and .env file the RN will read varables from .env.

@guillaumebesse
Copy link

I am using

"react-native": "^0.74.3",
"react-native-config": "^1.5.0",

It works but you should clean the project (using Xcode / Product / Clean build folder) before launching the app.

@ridvanaltun
Copy link

I am using

"react-native": "^0.74.3", "react-native-config": "^1.5.0",

It works but you should clean the project (using Xcode / Product / Clean build folder) before launching the app.

Yes, this works

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

9 participants