From e5f91babea34a1b3af3dfa6dd7f46ba6f812c8b9 Mon Sep 17 00:00:00 2001 From: mueller-ma Date: Fri, 23 Dec 2022 14:16:14 +0100 Subject: [PATCH] Update firebase to latest version Signed-off-by: mueller-ma --- .github/dependabot.yml | 2 -- mobile/build.gradle | 2 +- .../java/org/openhab/habdroid/core/FcmRegistrationWorker.kt | 4 +--- 3 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 34baf1ac0a6..8ba84480e66 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -14,5 +14,3 @@ updates: time: "04:00" timezone: Europe/Berlin open-pull-requests-limit: 99 - ignore: - - dependency-name: "com.google.firebase:firebase-bom" diff --git a/mobile/build.gradle b/mobile/build.gradle index 86c967b478c..b0fc22c809d 100644 --- a/mobile/build.gradle +++ b/mobile/build.gradle @@ -169,7 +169,7 @@ dependencies { implementation "com.mikepenz:aboutlibraries:$about_libraries_version" // Firebase - implementation platform("com.google.firebase:firebase-bom:25.11.0") + implementation platform("com.google.firebase:firebase-bom:31.1.1") fullImplementation "com.google.firebase:firebase-messaging-ktx" fullImplementation "com.google.firebase:firebase-crashlytics-ktx" diff --git a/mobile/src/full/java/org/openhab/habdroid/core/FcmRegistrationWorker.kt b/mobile/src/full/java/org/openhab/habdroid/core/FcmRegistrationWorker.kt index e97bccc28ee..377266689df 100644 --- a/mobile/src/full/java/org/openhab/habdroid/core/FcmRegistrationWorker.kt +++ b/mobile/src/full/java/org/openhab/habdroid/core/FcmRegistrationWorker.kt @@ -30,7 +30,6 @@ import androidx.work.OneTimeWorkRequest import androidx.work.WorkManager import androidx.work.WorkRequest import androidx.work.WorkerParameters -import com.google.firebase.iid.FirebaseInstanceId import com.google.firebase.messaging.FirebaseMessaging import com.google.firebase.messaging.RemoteMessage import java.io.IOException @@ -119,8 +118,7 @@ class FcmRegistrationWorker(private val context: Context, params: WorkerParamete // HttpException is thrown by our HTTP code, IOException can be thrown by FCM @Throws(HttpClient.HttpException::class, IOException::class) private suspend fun registerFcm(connection: CloudConnection) { - val token = FirebaseInstanceId.getInstance().getToken(connection.messagingSenderId, - FirebaseMessaging.INSTANCE_ID_SCOPE) + val token: String = FirebaseMessaging.getInstance().token.result val deviceName = deviceName + if (Util.isFlavorBeta) " (${context.getString(R.string.beta)})" else "" val deviceId = Settings.Secure.getString(context.contentResolver, Settings.Secure.ANDROID_ID) + if (Util.isFlavorBeta) "-beta" else ""