numandev1 / react-native-keys

πŸ” Protected .ENVs variables in React Native πŸš€βœ¨
MIT License
314 stars 28 forks source link

Keys not working on iOS #44

Closed dayaki closed 3 months ago

dayaki commented 1 year ago

Current behavior

Installed the package, did pod install, created keys.development.json file with secure entries:

{ "secure": { "APP_URL": "website-url.com", } }

but I can't access them, they return empty when I do console.log('keys', Keys.secureFor('APP_URL'))

Expected behavior

console.log('keys 2', Keys.secureFor('APP_URL')) should return the expected data in secure: { "APP_URL": "url"}

Platform

Versions

React Native Version -> 0.71.11 React Native Keys -> 0.5.14

github-actions[bot] commented 1 year ago

πŸ‘‹ @dayaki Thanks for opening your issue here! If you find this package useful hit the star🌟!

numandev1 commented 1 year ago

@dayaki did you add this script in pre-action?

    export KEYSFILE = "keys.development.json"
   "${SRCROOT}/../node_modules/react-native-keys/keysIOS.js"
dayaki commented 1 year ago

Just added it now and same issue. Do I need to follow the steps listed here https://github.com/numandev1/react-native-keys#ios ? even if I don't plan to access the variables from the native side?

numandev1 commented 1 year ago

@dayaki no you don't need those steps, can we see it on zoom session?

dayaki commented 1 year ago

yes sure

numandev1 commented 1 year ago

@dayaki can you connect with me on LinkedIn https://www.linkedin.com/in/numandev/ where we can send zoom session

dayaki commented 1 year ago

@numandev1 I figured it out...I was adding the scheme script in run pre-action instead of build pre-action. Would you advice thekeys.*.json files be added to git or be .gitignore

numandev1 commented 1 year ago

@dayaki Yes, I advise you to add product keys.json into gitignore not dev or staging otherwise you have to involve in the setup of every new developer in the team

numandev1 commented 1 year ago

@dayaki would you like to make PR for improve documentation of this package or you can give feedback i can change, thanks

github-actions[bot] commented 3 months ago

This issue is stale because it has been open 365 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] commented 3 months ago

This issue was closed because it has been stalled for 7 days with no activity.