Skip to content

Commit

Permalink
fix remote result bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahmad Idrees committed Dec 5, 2022
1 parent 0c12f2b commit 4f4b3b2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}
Expand Down

0 comments on commit 4f4b3b2

Please sign in to comment.