From 0727d6ba32abda997fda39e08e7c453be44e2aac Mon Sep 17 00:00:00 2001 From: HLCaptain Date: Tue, 4 Apr 2023 23:07:47 +0200 Subject: [PATCH] Version bump to `0.2.6-alpha`. Fixed issue with remoteConfig not working properly. --- app/build.gradle | 4 ++-- .../java/illyan/jay/domain/interactor/AuthInteractor.kt | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index fe06a522..9154cdba 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -40,8 +40,8 @@ android { applicationId "illyan.jay" minSdk 21 targetSdk 33 - versionCode 8 - versionName "0.2.5-alpha" + versionCode 9 + versionName "0.2.6-alpha" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { diff --git a/app/src/main/java/illyan/jay/domain/interactor/AuthInteractor.kt b/app/src/main/java/illyan/jay/domain/interactor/AuthInteractor.kt index 3d02b92b..b9761cc1 100644 --- a/app/src/main/java/illyan/jay/domain/interactor/AuthInteractor.kt +++ b/app/src/main/java/illyan/jay/domain/interactor/AuthInteractor.kt @@ -32,9 +32,8 @@ import com.google.firebase.analytics.ktx.logEvent import com.google.firebase.auth.AuthCredential import com.google.firebase.auth.FirebaseAuth import com.google.firebase.auth.GoogleAuthProvider -import com.google.firebase.ktx.Firebase +import com.google.firebase.remoteconfig.FirebaseRemoteConfig import com.google.firebase.remoteconfig.ktx.get -import com.google.firebase.remoteconfig.ktx.remoteConfig import illyan.jay.MainActivity import illyan.jay.R import illyan.jay.di.CoroutineScopeIO @@ -60,6 +59,7 @@ class AuthInteractor @Inject constructor( private val auth: FirebaseAuth, private val context: Context, private val analytics: FirebaseAnalytics, + private val remoteConfig: FirebaseRemoteConfig, @CoroutineScopeIO private val coroutineScopeIO: CoroutineScope, ) { private val _currentUserStateFlow = MutableStateFlow(auth.currentUser) @@ -137,12 +137,12 @@ class AuthInteractor @Inject constructor( fun signInViaGoogle(activity: MainActivity) { if (isUserSignedIn) return if (_googleSignInClient.value == null) { - Firebase.remoteConfig.fetchAndActivate().addOnCompleteListener { + remoteConfig.ensureInitialized().addOnCompleteListener { _googleSignInClient.value = GoogleSignIn.getClient( activity, GoogleSignInOptions .Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) - .requestIdToken(Firebase.remoteConfig["default_web_client_id"].asString()) + .requestIdToken(remoteConfig["default_web_client_id"].asString()) .requestEmail() .build() )