Updated on 2026-08-14

This commit is contained in:
Tangem 2021-03-01 15:46:04 +03:00
parent 4435a92f9d
commit a345df3c84
28 changed files with 647 additions and 60 deletions

View file

@ -4,6 +4,7 @@ import android.app.Application
import com.google.firebase.ktx.Firebase
import com.google.firebase.remoteconfig.ktx.remoteConfig
import com.google.firebase.remoteconfig.ktx.remoteConfigSettings
import com.tangem.Log
import com.tangem.tap.common.images.PicassoHelper
import com.tangem.tap.common.redux.AppState
import com.tangem.tap.common.redux.appReducer
@ -13,6 +14,9 @@ import com.tangem.tap.domain.configurable.config.FeaturesLocalLoader
import com.tangem.tap.domain.configurable.config.FeaturesRemoteLoader
import com.tangem.tap.domain.configurable.warningMessage.RemoteWarningLoader
import com.tangem.tap.domain.configurable.warningMessage.WarningMessagesManager
import com.tangem.tap.features.feedback.AdditionalEmailInfo
import com.tangem.tap.features.feedback.FeedbackManager
import com.tangem.tap.features.feedback.TangemLogCollector
import com.tangem.tap.network.NetworkConnectivity
import com.tangem.tap.network.createMoshi
import com.tangem.tap.persistence.PreferencesStorage
@ -46,10 +50,10 @@ class TapApplication : Application() {
preferencesStorage = PreferencesStorage(this)
PicassoHelper.initPicassoWithCaching(this)
initFeedbackManager()
loadConfigs()
}
private fun loadConfigs() {
val moshi = createMoshi()
val localLoader = FeaturesLocalLoader(this, moshi)
@ -59,4 +63,15 @@ class TapApplication : Application() {
val warningsManager = WarningMessagesManager(RemoteWarningLoader(moshi))
warningsManager.load { store.dispatch(GlobalAction.SetWarningManager(warningsManager)) }
}
private fun initFeedbackManager() {
val infoHolder = AdditionalEmailInfo()
infoHolder.updateAppVersion(this)
val logWriter = TangemLogCollector()
Log.addLogger(logWriter)
val feedbackManager = FeedbackManager(infoHolder, this, logWriter)
store.dispatch(GlobalAction.SetFeedbackManager(feedbackManager))
}
}