Skip to content

Instantly share code, notes, and snippets.

@ranmyfriend
Last active October 3, 2017 09:12
Show Gist options
  • Save ranmyfriend/983937c8c988853258cce14aed9e8dfc to your computer and use it in GitHub Desktop.
Save ranmyfriend/983937c8c988853258cce14aed9e8dfc to your computer and use it in GitHub Desktop.
Here you can load different set of environment variables for the staging and production environment
var envName:String = ""
#if Handstand || HandstandLiveDev
envName = "Handstand-GoogleService-Info"
#elseif HandstandStage
envName = "Handstand-Dev-GoogleService-Info"
#endif
let filePath = Bundle.main.path(forResource: envName, ofType: "plist")
FirebaseApp.configure(options: FirebaseOptions.init(contentsOfFile: filePath!)!)
/*Refer: https://stackoverflow.com/questions/37472090/in-new-firebase-how-to-use-multiple-config-file-in-xcode/40542853#40542853*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment