Skip to content

Instantly share code, notes, and snippets.

@yveskalume
Last active August 19, 2022 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yveskalume/ed232027430614fb66470b913ff95c5c to your computer and use it in GitHub Desktop.
Save yveskalume/ed232027430614fb66470b913ff95c5c to your computer and use it in GitHub Desktop.
class App : Application() {
override fun onCreate() { 
super.onCreate()
val devOptions = FirebaseOptions.Builder()
.setProjectId("beserved-development-project")
.setApplicationId("1:212877806437:android:fee5f52927e2f7a907ed8c")
.setApiKey("AIzaSyADUe90ULnQDuGShD9W23RDP0xmeDc6Mvw")
.build()
val prodOptions = FirebaseOptions.Builder()
.setProjectId("beserved-production-project")
.setApplicationId("1:27992087142:android:ce3b6448250083d1")
.setApiKey("BIzaSyADUe90ULnQDuGShD9W23RDP0xmeDc6Mvw")
.build()
// here we check wich instance to use depending on the build type 
if(BuildConfig.DEBUG) {
FirebaseApp.initializeApp(this, devOptions, "beserved-development")
} else {
FirebaseApp.initializeApp(this, prodOptions, "beserved-production")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment