To use the Firebase Common Android SDK with Kotlin Extensions, add the following
to your app's build.gradle
file:
// See maven.google.com for the latest versions
// This library transitively includes the firebase-common library
implementation 'com.google.firebase:firebase-common-ktx:$VERSION'
Kotlin
val defaultApp = FirebaseApp.getInstance()
val defaultOptions = defaultApp.options
Kotlin + KTX
val defaultApp = Firebase.app
val defaultOptions = Firebase.options
Kotlin
val options = FirebaseApp.getInstance().options
val anotherApp = FirebaseApp.initializeApp(context, options, "myApp")
Kotlin + KTX
var anotherApp = Firebase.initialize(context, Firebase.options, "myApp")