removed duplicate firebaseremoteconfig helper

This commit is contained in:
Jegatheeswaran M
2022-11-29 07:28:35 +05:30
parent 88ec9418d3
commit b6bbe72be5
2 changed files with 1 additions and 55 deletions

View File

@@ -18,6 +18,7 @@ import com.navi.base.sharedpref.CommonPrefConstants.USER_EXTERNAL_ID
import com.navi.base.sharedpref.PreferenceManager
import com.navi.base.utils.BaseUtils
import com.navi.common.CommonLibManager
import com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper
import com.navi.common.utils.CommonUtils
import com.navi.common.utils.getSessionId
import com.navi.common.utils.updateSessionId
@@ -27,7 +28,6 @@ import com.naviapp.R
import com.naviapp.analytics.deeplink.DeeplinkManager
import com.naviapp.app.NaviApplication
import com.naviapp.common.navigator.NaviDeepLinkNavigator
import com.naviapp.firebaseremoteconfig.FirebaseRemoteConfigHelper
import com.naviapp.manager.UserManager
import com.naviapp.payment.razorpay.RazorpayPayment
import com.naviapp.registration.SplashActivity
@@ -40,7 +40,6 @@ import timber.log.Timber
object NaviSDKHelper {
fun init(naviApplication: NaviApplication) {
FirebaseRemoteConfigHelper.init()
com.navi.common.firebaseremoteconfig.FirebaseRemoteConfigHelper.init() // Initialization the same class for testing
val inAppOptOutScreens = mutableSetOf<Class<*>>()
inAppOptOutScreens.add(SplashActivity::class.java)
NaviTrackEvent.appInit(

View File

@@ -1,53 +0,0 @@
/*
*
* * Copyright © 2019 by Navi Technologies Private Limited
* * All rights reserved. Strictly confidential
*
*/
package com.naviapp.firebaseremoteconfig
import com.google.firebase.ktx.Firebase
import com.google.firebase.remoteconfig.FirebaseRemoteConfig
import com.google.firebase.remoteconfig.ktx.remoteConfig
import com.google.firebase.remoteconfig.ktx.remoteConfigSettings
import com.naviapp.BuildConfig
import com.naviapp.R
object FirebaseRemoteConfigHelper {
private lateinit var remoteConfig: FirebaseRemoteConfig
private const val CONFIG_SYNC_INTERVAL: Long = 60 * 60
const val LOGIN_PAGE = "LOGIN_PAGE"
const val NEWRELIC_ENABLED = "NEWRELIC_ENABLED_V2"
const val RAGE_TAP_COUNT = "RAGE_TAP_COUNT"
const val APP_SPLASH_LOGO = "APP_SPLASH_LOGO"
const val RAGE_TAP_DELAY_TIME = "RAGE_TAP_DELAY_TIME"
const val GST_USERNAME_PASSWORD_MAX_LIMIT = "GST_USERNAME_PASSWORD_MAX_LIMIT"
const val HELP_LINE_NUMBER = "HELP_LINE_NUMBER"
fun init() {
remoteConfig = getFirebaseRemoteConfig()
}
private fun getFirebaseRemoteConfig(): FirebaseRemoteConfig {
val remoteConfig = Firebase.remoteConfig
val configSettings = remoteConfigSettings {
minimumFetchIntervalInSeconds = if (BuildConfig.DEBUG) {
0
} else {
CONFIG_SYNC_INTERVAL
}
}
remoteConfig.setConfigSettingsAsync(configSettings)
remoteConfig.setDefaultsAsync(R.xml.default_remote_config)
remoteConfig.fetchAndActivate().addOnCompleteListener {}
return remoteConfig
}
fun getString(key: String): String = remoteConfig.getString(key)
fun getBoolean(key: String): Boolean = remoteConfig.getBoolean(key)
fun getDouble(key: String): Double = remoteConfig.getDouble(key)
fun getLong(key: String): Long = remoteConfig.getLong(key)
}