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

There is no doc about how to use env variables in Info.plist or {Project}.entitlements #387

Closed
mav10 opened this issue Sep 10, 2019 · 6 comments

Comments

@mav10
Copy link

mav10 commented Sep 10, 2019

Guys, thanks for your package, everything is cool, but I didn't get anything according to the configuration of iOS project.

First thing - why in readme or whatever else there are no mentions about prefix which we should use in iOS proj? I mean __RN_CONFIG_. I found it by chance somewhere in issues.

  • And by the way should i?

Second things is that - i'm sorry but for me it's not clear how to configure xCode for getting env-variables in Info.plist. Yes you've got "extra step" how to do it, but i didn't get the main thing - it's a snippet in the last step. What should i do with that?

"${SRCROOT}/../node_modules/react-native-config/ios/ReactNativeConfig/BuildXCConfig.rb" "${SRCROOT}/.." "${SRCROOT}/tmp.xcconfig"

Could you provide an example, please?

And I'll ask one more time - but is it possible somehow to use a variable in the {Project}.entitlements for associated domains as in Info.plist.

@mav10 mav10 closed this as completed Sep 11, 2019
@mav10
Copy link
Author

mav10 commented Sep 11, 2019

found solution in #365

@sergiulucaci
Copy link

@mav10 but how are you using this solution to use env in {Project.entitlements}?

@pragneshpj
Copy link

how can i get __RN_CONFIG_BundleVersion in Info.plist?
can anyone help me

@luisfuertes
Copy link

@sergiulucaci @mav10 any update about this? how are you using this solution to use env in {Project.entitlements}?

@Adnan-Bacic
Copy link

Adnan-Bacic commented Nov 14, 2022

still no update/solution for this?

edit:
i guess maybe instead of using env variables for ios, you should instead rely on different entitlement files. if you go to Signing & Capabilities, you can choose which build configurations you want to add Associated Domains to.

if you just use have it set to All, it creates a projectname.entitlements file. i have a staging environment too, so i also see Debug-Stanging and Release-Staging.

select one of these and add a new domain. it will say This change requires an additional Entitlements file., then it creates another file. add the domains you want.

you will then have a ProjectNameDebug-Staging.entitlements and ProjectNameRelease-Staging.entitlements.

i suspect this will work fine.

@PierreCapo
Copy link

For entitlements fine, indeed you can do the same mechanic GoogleInfoServices for firebase:

  1. Create one entitlement file per environment
  2. In the scheme schema, add a pre-action build to copy the entitlement for the environment file to override the one used by your app 👍

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

6 participants