iOS Swift:Firebase远程配置获取值
是否有方法或委托在应用程序运行时捕获更新的值而不终止应用程序。我正在使用此方法获取值并进行更新iOS Swift:Firebase远程配置获取值,ios,swift,firebase,firebase-remote-config,Ios,Swift,Firebase,Firebase Remote Config,是否有方法或委托在应用程序运行时捕获更新的值而不终止应用程序。我正在使用此方法获取值并进行更新 RemoteConfig.remoteConfig().fetch(withExpirationDuration: duration) { [weak self] (status, error) in guard error == nil else { print("Got an error fetching remote values \(error
RemoteConfig.remoteConfig().fetch(withExpirationDuration: duration) { [weak self] (status, error) in
guard error == nil else {
print("Got an error fetching remote values \(error!)")
return
}
print ("Retrieved values from the cloud!")
RemoteConfig.remoteConfig().activateFetched()
guard let strongSelf = self else { return }
strongSelf.updateWithRomteConfigValues()
}
activateFetched()
调用将确保在无需终止应用程序的情况下获取最新的更新数据(从默认设置或远程配置)。我认为你的问题来自持续时间。
尝试将持续时间设置为0(确保仅在开发人员模式为时才执行此操作)请记住,不要在启用开发人员模式的情况下发布应用程序,否则您将在获取时看到异常,因为您将超过配额。