From 4f4b3b25d761e73aba7446e4c344029d9a6e93cc Mon Sep 17 00:00:00 2001 From: Ahmad Idrees Date: Mon, 5 Dec 2022 10:59:11 +0500 Subject: [PATCH] fix remote result bug --- .../ai/bom/firebase/lib/analytics/FirebaseAnalytics.kt | 8 ++++++-- .../ai/bom/firebase/lib/config/RemoteConfigData.kt | 10 +++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/firebaseLib/src/main/java/ai/bom/firebase/lib/analytics/FirebaseAnalytics.kt b/firebaseLib/src/main/java/ai/bom/firebase/lib/analytics/FirebaseAnalytics.kt index 56f4385..b87c370 100644 --- a/firebaseLib/src/main/java/ai/bom/firebase/lib/analytics/FirebaseAnalytics.kt +++ b/firebaseLib/src/main/java/ai/bom/firebase/lib/analytics/FirebaseAnalytics.kt @@ -3,6 +3,7 @@ package ai.bom.firebase.lib.analytics import android.content.Context import android.os.Bundle import androidx.annotation.Keep +import androidx.annotation.Size import com.google.firebase.analytics.FirebaseAnalytics @Keep @@ -11,10 +12,13 @@ class FirebaseAnalytics(context: Context) { /** * Command to Enable Analytics in Debug Mode - * Command : adb shell setprop debug.firebase.analytics.app packageName + * Command 1: adb shell setprop debug.firebase.analytics.app packageName + * Command 2: adb shell setprop log.tag.FA VERBOSE + * Command 3: adb shell setprop log.tag.FA-SVC VERBOSE + * Command 4: adb logcat -v time -s FA FA-SVC * */ - fun sendEventAnalytics(eventName: String, eventStatus: String) { + fun sendEventAnalytics(@Size(min = 1L, max = 40L) eventName: String, eventStatus: String) { val bundle = Bundle() bundle.putString(FirebaseAnalytics.Param.VALUE, eventStatus) firebaseAnalytics.logEvent(eventName, bundle) diff --git a/firebaseLib/src/main/java/ai/bom/firebase/lib/config/RemoteConfigData.kt b/firebaseLib/src/main/java/ai/bom/firebase/lib/config/RemoteConfigData.kt index 121760f..20b297f 100644 --- a/firebaseLib/src/main/java/ai/bom/firebase/lib/config/RemoteConfigData.kt +++ b/firebaseLib/src/main/java/ai/bom/firebase/lib/config/RemoteConfigData.kt @@ -42,13 +42,9 @@ class RemoteConfigDate(private val remoteTopic: String) { fun getRemoteConfig(context: Context, listener: ((Any?) -> Unit)) { getInstance()?.reset() getInstance()?.fetchAndActivate() - ?.addOnCompleteListener { task -> - if (task.isSuccessful) { - val value = getRemoteConfig(context) - listener.invoke(value) - } else { - listener.invoke(null) - } + ?.addOnCompleteListener { _ -> + val value = getRemoteConfig(context) + listener.invoke(value) } } }