Firebase: Migrate to using the Kotlin extensions (KTX) APIs in the main modules

https://firebase.google.com/docs/android/kotlin-migration

Requirements: Firebase BoM 32.5.0, but let's update to the latest 32.6.0.

And remove warnings:
- `'logEvent(String, ParametersBuilder.() -> Unit): Unit' is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.`
- `'param(String, String): Unit' is deprecated. Migrate to use the KTX API from the main module: https://firebase.google.com/docs/android/kotlin-migration.`
pull/1062/head
Simon Marquis 1 year ago
parent b3f5548fe2
commit 382eb1e695

@ -17,8 +17,8 @@
package com.google.samples.apps.nowinandroid.core.analytics
import com.google.firebase.analytics.FirebaseAnalytics
import com.google.firebase.analytics.ktx.analytics
import com.google.firebase.ktx.Firebase
import com.google.firebase.analytics.analytics
import com.google.firebase.Firebase
import dagger.Binds
import dagger.Module
import dagger.Provides
@ -35,6 +35,6 @@ abstract class AnalyticsModule {
companion object {
@Provides
@Singleton
fun provideFirebaseAnalytics(): FirebaseAnalytics { return Firebase.analytics }
fun provideFirebaseAnalytics(): FirebaseAnalytics = Firebase.analytics
}
}

@ -17,7 +17,7 @@
package com.google.samples.apps.nowinandroid.core.analytics
import com.google.firebase.analytics.FirebaseAnalytics
import com.google.firebase.analytics.ktx.logEvent
import com.google.firebase.analytics.logEvent
import javax.inject.Inject
/**

@ -31,7 +31,7 @@ androidxUiAutomator = "2.2.0"
androidxWindowManager = "1.1.0"
androidxWork = "2.9.0-rc01"
coil = "2.4.0"
firebaseBom = "32.4.0"
firebaseBom = "32.6.0"
firebaseCrashlyticsPlugin = "2.9.9"
firebasePerfPlugin = "1.4.2"
gmsPlugin = "4.4.0"
@ -104,11 +104,11 @@ androidx-work-testing = { group = "androidx.work", name = "work-testing", versio
coil-kt = { group = "io.coil-kt", name = "coil", version.ref = "coil" }
coil-kt-compose = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil" }
coil-kt-svg = { group = "io.coil-kt", name = "coil-svg", version.ref = "coil" }
firebase-analytics = { group = "com.google.firebase", name = "firebase-analytics-ktx" }
firebase-analytics = { group = "com.google.firebase", name = "firebase-analytics" }
firebase-bom = { group = "com.google.firebase", name = "firebase-bom", version.ref = "firebaseBom" }
firebase-cloud-messaging = { group = "com.google.firebase", name = "firebase-messaging-ktx" }
firebase-crashlytics = { group = "com.google.firebase", name = "firebase-crashlytics-ktx" }
firebase-performance = { group = "com.google.firebase", name = "firebase-perf-ktx" }
firebase-cloud-messaging = { group = "com.google.firebase", name = "firebase-messaging" }
firebase-crashlytics = { group = "com.google.firebase", name = "firebase-crashlytics" }
firebase-performance = { group = "com.google.firebase", name = "firebase-perf" }
firebase-performance-gradle = { group = "com.google.firebase", name = "perf-plugin", version.ref = "firebasePerfPlugin" }
google-oss-licenses = { group = "com.google.android.gms", name = "play-services-oss-licenses", version.ref = "googleOss" }
google-oss-licenses-plugin = { group = "com.google.android.gms", name = "oss-licenses-plugin", version.ref = "googleOssPlugin" }

@ -16,9 +16,9 @@
package com.google.samples.apps.nowinandroid.sync.di
import com.google.firebase.ktx.Firebase
import com.google.firebase.Firebase
import com.google.firebase.messaging.FirebaseMessaging
import com.google.firebase.messaging.ktx.messaging
import com.google.firebase.messaging.messaging
import com.google.samples.apps.nowinandroid.core.data.util.SyncManager
import com.google.samples.apps.nowinandroid.sync.status.FirebaseSyncSubscriber
import com.google.samples.apps.nowinandroid.sync.status.SyncSubscriber

Loading…
Cancel
Save