Sunday, October 15, 2023
HomeiOS Developmentios - The right way to learn atmosphere variable from .env file...

ios – The right way to learn atmosphere variable from .env file utilizing Xcode?


With a purpose to maintain api key secret and never arduous coding them in code I’ve created .env file the place I’ve set the worth of key proven under. Now I need to inject this worth throughout construct time.

1 .env file

API_KEY=”2131224″

2 I’ve additionally added the next run script
#!/usr/bin/env bash

grep -v ‘^#’ .env

export $(grep -v ‘^#’ .env | xargs)

3 Throughout compile time I’m able to see the API_KEY in logs, However I don’t know learn how to assign it to var throughout api name.

enter image description here

I attempted to entry worth utilizing ProcessInfo, however it didn’t work.

ProcessInfo.processInfo.atmosphere[“API_KEY”]

Any concept how can I entry this?



Supply hyperlink

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments