TP-69266 | Made pulse config param firebase configurable (#11163)
This commit is contained in:
@@ -28,6 +28,8 @@ import com.navi.base.utils.BaseUtils
|
||||
import com.navi.common.CommonLibManager
|
||||
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper
|
||||
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper.DISABLE_ALFRED
|
||||
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper.PULSE_EVENT_BATCH_SIZE
|
||||
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper.PULSE_EVENT_INTERVAL_IN_SECS
|
||||
import com.navi.common.managers.UserManager
|
||||
import com.navi.common.receiver.AlfredNetworkFailureReceiver
|
||||
import com.navi.common.utils.CommonUtils
|
||||
@@ -84,7 +86,15 @@ object NaviSDKHelper {
|
||||
disableAlfredLogs =
|
||||
FirebaseRemoteConfigHelper.getBoolean(AlfredConstants.DISABLE_ALFRED_LOGS),
|
||||
disableAlfred = FirebaseRemoteConfigHelper.getBoolean(DISABLE_ALFRED),
|
||||
pulseConfig = PulseConfig(pulseUrl = BuildConfig.PULSE_BASE_URL)
|
||||
pulseConfig =
|
||||
PulseConfig(
|
||||
pulseUrl = BuildConfig.PULSE_BASE_URL,
|
||||
eventBatchSize =
|
||||
FirebaseRemoteConfigHelper.getLong(PULSE_EVENT_BATCH_SIZE).toInt(),
|
||||
eventInterval =
|
||||
FirebaseRemoteConfigHelper.getLong(PULSE_EVENT_INTERVAL_IN_SECS)
|
||||
.toInt()
|
||||
)
|
||||
),
|
||||
inAppOptOutScreens
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
*
|
||||
* * Copyright © 2021-2023 by Navi Technologies Limited
|
||||
* * Copyright © 2021-2024 by Navi Technologies Limited
|
||||
* * All rights reserved. Strictly confidential
|
||||
*
|
||||
*/
|
||||
@@ -30,7 +30,7 @@ data class MoengageData(
|
||||
val xiaomiPushAppKey: String
|
||||
)
|
||||
|
||||
data class PulseConfig(val pulseUrl: String) {
|
||||
data class PulseConfig(val pulseUrl: String, val eventBatchSize: Int, val eventInterval: Int) {
|
||||
val pulseCallback =
|
||||
object : PulseCallback {
|
||||
override fun sendResponse(response: Response<*>) {
|
||||
|
||||
@@ -49,6 +49,8 @@ object NaviTrackEvent {
|
||||
.setAppVersion(analyticsConfiguration.appInfo.appVersionCode)
|
||||
.setAppVersionName(analyticsConfiguration.appInfo.appVersionName)
|
||||
.setDestinationUrl(analyticsConfiguration.pulseConfig.pulseUrl)
|
||||
.setEventBatchSize(analyticsConfiguration.pulseConfig.eventBatchSize)
|
||||
.setEventInterval(analyticsConfiguration.pulseConfig.eventInterval)
|
||||
.build()
|
||||
if (analyticsConfiguration.disableAlfred.not()) {
|
||||
val alfredConfig =
|
||||
|
||||
@@ -154,6 +154,9 @@ object FirebaseRemoteConfigHelper {
|
||||
const val RESOURCE_MANAGER_URL_LIST = "RESOURCE_MANAGER_URL_LIST"
|
||||
const val RESOURCE_MANAGER_ENABLED = "RESOURCE_MANAGER_ENABLED"
|
||||
|
||||
const val PULSE_EVENT_BATCH_SIZE = "PULSE_EVENT_BATCH_SIZE"
|
||||
const val PULSE_EVENT_INTERVAL_IN_SECS = "PULSE_EVENT_INTERVAL_IN_SECS"
|
||||
|
||||
fun init() {
|
||||
remoteConfig = getFirebaseRemoteConfig()
|
||||
}
|
||||
|
||||
@@ -525,4 +525,12 @@
|
||||
<key>RESOURCE_MANAGER_URL_LIST</key>
|
||||
<value>{}</value>
|
||||
</entry>
|
||||
<entry>
|
||||
<key>PULSE_EVENT_BATCH_SIZE</key>
|
||||
<value>50</value>
|
||||
</entry>
|
||||
<entry>
|
||||
<key>PULSE_EVENT_INTERVAL_IN_SECS</key>
|
||||
<value>60</value>
|
||||
</entry>
|
||||
</defaultsMap>
|
||||
Reference in New Issue
Block a user