iOS Swift:Firebase远程配置获取值

问题描述 投票:2回答:1

是否有方法或委托在应用程序运行时捕获更新的值而不终止应用程序。我正在使用此方法来获取值并进行更新。

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

    }
ios swift firebase firebase-remote-config
1个回答
0
投票

activateFetched()调用将确保获取最新的更新数据(来自默认值或远程配置),而无需终止应用程序。 我认为您案件中的问题来自持续时间。 尝试将持续时间设置为0(确保仅在开发者模式为enabled时才执行此操作)

© www.soinside.com 2019 - 2024. All rights reserved.