Skip to content

Commit 96066d0

Browse files
author
Ahmad Idrees
committed
fix remote result bug
1 parent 4f4b3b2 commit 96066d0

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

firebaseLib/src/main/java/ai/bom/firebase/lib/config/RemoteConfigData.kt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package ai.bom.firebase.lib.config
22

33
import ai.bom.firebase.lib.BuildConfig
44
import android.content.Context
5+
import android.util.Log
56
import androidx.annotation.Keep
67
import com.google.firebase.remoteconfig.FirebaseRemoteConfig
78
import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings
@@ -42,9 +43,14 @@ class RemoteConfigDate(private val remoteTopic: String) {
4243
fun getRemoteConfig(context: Context, listener: ((Any?) -> Unit)) {
4344
getInstance()?.reset()
4445
getInstance()?.fetchAndActivate()
45-
?.addOnCompleteListener { _ ->
46-
val value = getRemoteConfig(context)
47-
listener.invoke(value)
46+
?.addOnCompleteListener { task ->
47+
Log.e("RemoteConfigNew*", "status : ${task.isSuccessful}")
48+
if (task.isSuccessful) {
49+
val value = getRemoteConfig(context)
50+
listener.invoke(value)
51+
} else {
52+
listener.invoke(getRemoteConfig(context))
53+
}
4854
}
4955
}
5056
}

0 commit comments

Comments
 (0)