Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

OAuth API keys configuration file

What is the preferred way to store the API keys or environment configuration variables in an Xcode project? In RubyOnRails there is a Gem called dotenv (https://github.com/bkeepers/dotenv) so you don't have to expose the API passwords/credential to anyone through GIT, instead you create a file that includes all the API keys and add the file to .gitignore so no one can see the passwords.

1 Answer

Hi George,

This can be an issue, yes. I use a config file that contains any API keys which isn't held in version control; it's added to .gitignore.

There's a post here that explains many other options ways better than I can!

I hope that helps

Steve.