I am working on a Xamarin solution with iOS and Android projects that reference a common PCL project. The common PCL project has code for making requests to a backend REST service, which requires client authentication to create new accounts. I.e. the client must have a valid API key in order to create new accounts. The entire solution is in a git repository that is open source, so it's not possible to store the API key in a string constant in a class or in any of the checked in solution/project/property files.
Is there a best practice for storing these secrets and making them accessible at build time?
For example, is there a way to store the key in a file, or the keychain on OS X, and then include that value when building and expose it as a constant at runtime?
(I apologize in advance if this is a duplicate, but I couldn't find an equivalent question in my searching.)