Stone Preston
Stone Preston

Reputation: 1868

hiding API keys in public github repo in iOS

Im using the parse framework in my app which I want to put on github in a public repo. Ive got some parse API keys in my app delegate that I dont want others to be able to use. This is my first app and im not really sure how to "hide" them. What would be the best way to accomplish this?

Upvotes: 1

Views: 1576

Answers (2)

Paulo
Paulo

Reputation: 1245

Put them in a Plist, give instructions to fill it up and blank your own key out. Or better still, prompt the user for the API key i a one time routine to create the Plist

Upvotes: 0

Daij-Djan
Daij-Djan

Reputation: 50129

Put them in a external file that you never commit. that's most convenient IMO.

e.g. have a keys.plist and in the appDelegate, just read the keys.plist


Of course another way that is quite error prone is to blank them using * before you commit your source but... nah.. :P

Upvotes: 1

Related Questions