To use Compiler Directives configure directives for each Build Configuration in Xamarin / Visual Studio
White Label Api Access Compiler Directives

Then add a ApiAccountSettings file to the PCL Project

TheAppsPajamas.White/Constants/ApiAccountSettings.cs

You can now use the two constants when connecting to the API

  • Username
  • Password

TheAppsPajamas.White/Api/PrepareApiRequest.cs
info

This is our second favourite option. The difficulty in refactoring, or reliably adding new constants is our biggest issue with it