-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into release/fairer2.1
# Conflicts: # app/src/main/java/com/depromeet/housekeeper/di/NetworkModule.kt
- Loading branch information
Showing
18 changed files
with
280 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
app/src/main/java/com/depromeet/housekeeper/HouseKeeperApplication.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
app/src/main/java/com/depromeet/housekeeper/di/RemoteConfigWrapper.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.depromeet.housekeeper.di | ||
|
||
import com.depromeet.housekeeper.R | ||
import com.depromeet.housekeeper.util.FIREBASE_SERVER_URL | ||
import com.google.firebase.remoteconfig.FirebaseRemoteConfig | ||
import com.google.firebase.remoteconfig.FirebaseRemoteConfigSettings | ||
import timber.log.Timber | ||
import javax.inject.Inject | ||
import javax.inject.Singleton | ||
|
||
@Singleton | ||
class RemoteConfigWrapper @Inject constructor() { | ||
private val remoteConfig: FirebaseRemoteConfig by lazy{ | ||
FirebaseRemoteConfig.getInstance().apply { | ||
val configSettings = FirebaseRemoteConfigSettings.Builder() | ||
.build() | ||
setConfigSettingsAsync(configSettings) | ||
setDefaultsAsync(R.xml.remote_config_default) // 먼저 안전하게 default 가져옴(remote config 변경되면 xml 변경해주기를 요망) | ||
} | ||
} | ||
|
||
fun fetchAndActivateConfig(): String { | ||
remoteConfig.fetchAndActivate().addOnCompleteListener{ task -> | ||
val updated = task.result | ||
if (task.isSuccessful){ | ||
val updated = task.result | ||
Timber.d("Config params updated success: $updated") | ||
} else { | ||
Timber.d("Config params updated failed: $updated") | ||
} | ||
} | ||
return remoteConfig.getString(FIREBASE_SERVER_URL) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.