OGeek|极客世界-中国程序员成长平台

标题: iOS swift : Firebase Remote Config fetch values [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-11 18:40
标题: iOS swift : Firebase Remote Config fetch values

有没有办法或委托(delegate)在应用程序运行时捕获更新的值而不终止应用程序。我正在使用这种方法来获取值并更新。

    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()

    }



Best Answer-推荐答案


activateFetched() 调用将确保获取最新的更新数据(来自默认设置或远程配置),而无需终止应用程序。
我认为你的问题来自持续时间。
尝试将持续时间设置为 0(确保仅在开发者模式为 enabled 时才这样做)

关于iOS swift : Firebase Remote Config fetch values,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46194616/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4