2017-09-13 119 views
2

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

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

    } 
+0

记住,不要发表与开发者模式的应用程序启用或者你会开始看到时获取的,你会在运行异常配额。 –

回答

0

activateFetched()通话将确保得到最新的更新数据(无论是从默认设置或远程配置),而无需终止应用程序。
我认为你的问题来自持续时间。
尝试的持续时间设置为0(确保只有这样做,如果开发商模式是enabled