Skip to content

Instantly share code, notes, and snippets.

@Widcket
Created January 16, 2019 19:57
Show Gist options
  • Save Widcket/166bd151925fbaec715659bf2ca0f5f1 to your computer and use it in GitHub Desktop.
Save Widcket/166bd151925fbaec715659bf2ca0f5f1 to your computer and use it in GitHub Desktop.
Invalidate Remote Config Cache
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