From c8106fb0464c2bc56c22edff167e36b554c5695f Mon Sep 17 00:00:00 2001 From: vrexpert Date: Fri, 17 May 2024 13:05:31 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=84=A0=ED=83=9D=20=EC=97=85=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=8A=B8=20=EC=9A=94=EC=B2=AD=20=EB=B2=84=EC=A0=84?= =?UTF-8?q?=EB=A7=8C=20=EC=84=A0=ED=83=9D=20=EC=97=85=EB=8D=B0=EC=9D=B4?= =?UTF-8?q?=ED=8A=B8=20=EC=B0=BD=EC=9D=84=20=EB=9D=84=EC=9A=B4=EB=8B=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../presentation/ui/splash/SplashActivity.kt | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/splash/SplashActivity.kt b/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/splash/SplashActivity.kt index 732692ddf..1f3da7b10 100644 --- a/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/splash/SplashActivity.kt +++ b/android/festago/presentation/src/main/java/com/festago/festago/presentation/ui/splash/SplashActivity.kt @@ -97,14 +97,27 @@ class SplashActivity : ComponentActivity() { } private fun requestUpdate(latestVersion: Long) { - val isForceUpdateVersion = firebaseRemoteConfig.getBoolean(KEY_FORCE_UPDATE_REQUIRED) val latestVersionDescription = firebaseRemoteConfig.getString(KEY_LATEST_VERSION_DESCRIPTION) + + if (checkForceUpdate(latestVersionDescription)) return + checkOptionalUpdate(latestVersion, latestVersionDescription) + } + + private fun checkForceUpdate(latestVersionDescription: String): Boolean { + val isForceUpdateVersion = firebaseRemoteConfig.getBoolean(KEY_FORCE_UPDATE_REQUIRED) if (isForceUpdateVersion) { requestForceUpdate(message = latestVersionDescription) - return + return true + } + return false + } + + private fun checkOptionalUpdate(latestVersion: Long, latestVersionDescription: String) { + val isOptionalUpdateVersion = firebaseRemoteConfig.getBoolean(KEY_OPTIONAL_UPDATE_REQUIRED) + if (isOptionalUpdateVersion) { + requestOptionalUpdate(latestVersion = latestVersion, message = latestVersionDescription) } - requestOptionalUpdate(latestVersion = latestVersion, message = latestVersionDescription) } private fun requestForceUpdate(message: String) { @@ -188,6 +201,7 @@ class SplashActivity : ComponentActivity() { private const val DEBUG_REMOTE_CONFIG_FETCH_INTERVAL = 0L private const val RELEASE_REMOTE_CONFIG_FETCH_INTERVAL = 3600L private const val KEY_FORCE_UPDATE_REQUIRED = "FORCE_UPDATE_REQUIRED" + private const val KEY_OPTIONAL_UPDATE_REQUIRED = "OPTIONAL_UPDATE_REQUIRED" private const val KEY_LATEST_VERSION = "LATEST_VERSION" private const val KEY_LATEST_VERSION_DESCRIPTION = "LATEST_VERSION_DESCRIPTION" }