Created
January 16, 2019 19:57
-
-
Save Widcket/166bd151925fbaec715659bf2ca0f5f1 to your computer and use it in GitHub Desktop.
Invalidate Remote Config Cache
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
var expirationDuration: TimeInterval = 43200 // 12hs of cache by default | |
| |
if UserDefaults.standard.bool(forKey: "CONFIG_STATE") { | |
UserDefaults.standard.set(false, forKey: "CONFIG_STATE") | |
UserDefaults.standard.synchronize() | |
expirationDuration = 0 | |
} | |
| |
RemoteConfig.fetch(withExpirationDuration: expirationDuration) { [weak self] status, error in | |
RemoteConfig.remoteConfig().activateFetched() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment