gpt4 book ai didi

ios - FIRRemoteConfig.activateFetched() 失败

转载 作者:搜寻专家 更新时间:2023-10-31 21:52:19 26 4
gpt4 key购买 nike

我已经实现了 FIRRemoteConfig 并在 firebase 控制台中添加了我的第一个值。但是,当我尝试激活获取的值时,它失败了,我的远程值永远不可用。

    let remote = FIRRemoteConfig.remoteConfig()
#if DEBUG
let expiration: TimeInterval = 0
remote.configSettings = FIRRemoteConfigSettings(developerModeEnabled: true)
#else
let expiration: TimeInterval = 24*60*60
#endif

var map = [String:NSObject]()
let defaults = RemoteSettings.defaults.keys
for key in defaults.keys {
map[key.rawValue] = defaults[key] as? NSObject
}
remote.setDefaults(map) // Have confirmed that map is valid here

remote.fetch(withExpirationDuration: expiration, completionHandler: { (status, error) in
// status always == .success, but remote.activateFetched() always returns false.
if status == .success && remote.activateFetched() {
print("applied remote settings")
} else {
print("failed to apply remote settings: \(error)")
}
})

最佳答案

经过反复试验,我终于明白了。问题出在过期值上,将过期值设置为0秒即可看到立即生效的效果!

我希望这可以为其他人节省很多时间!

关于ios - FIRRemoteConfig.activateFetched() 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42759109/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com