@@ -6,11 +6,14 @@ package com.thewizrd.simpleweather.extras
66import android.content.ActivityNotFoundException
77import android.content.Context
88import android.content.Intent
9+ import androidx.lifecycle.lifecycleScope
910import androidx.navigation.findNavController
1011import androidx.preference.Preference
1112import com.google.android.gms.maps.MapsInitializer
1213import com.google.android.gms.maps.MapsInitializer.Renderer
1314import com.google.android.play.core.splitcompat.SplitCompat
15+ import com.google.firebase.installations.ktx.installations
16+ import com.google.firebase.ktx.Firebase
1417import com.thewizrd.extras.extrasModule
1518import com.thewizrd.shared_resources.appLib
1619import com.thewizrd.shared_resources.store.PlayStoreUtils
@@ -21,10 +24,13 @@ import com.thewizrd.simpleweather.NavGraphDirections
2124import com.thewizrd.simpleweather.R
2225import com.thewizrd.simpleweather.locale.UserLocaleActivity
2326import com.thewizrd.simpleweather.preferences.BaseSettingsFragment
27+ import com.thewizrd.simpleweather.preferences.DevSettingsFragment
2428import com.thewizrd.simpleweather.preferences.SettingsFragment
2529import com.thewizrd.simpleweather.preferences .`SettingsFragment $IconsFragmentDirections `
2630import com.thewizrd.simpleweather.snackbar.Snackbar
2731import com.thewizrd.simpleweather.utils.NavigationUtils.safeNavigate
32+ import kotlinx.coroutines.launch
33+ import kotlinx.coroutines.tasks.await
2834import timber.log.Timber
2935
3036fun initializeExtras () {
@@ -179,4 +185,13 @@ fun SettingsFragment.AboutAppFragment.setupReviewPreference(preference: Preferen
179185 }
180186 }
181187 }
188+ }
189+
190+ fun DevSettingsFragment.updateFirebaseIdPreference (preference : Preference ) {
191+ runCatching {
192+ lifecycleScope.launch {
193+ val firebaseId = Firebase .installations.id.await()
194+ preference.summary = firebaseId
195+ }
196+ }
182197}
0 commit comments