Android - 应用更新时的 Firebase 远程配置缓存

Posted

技术标签:

【中文标题】Android - 应用更新时的 Firebase 远程配置缓存【英文标题】:Android - Firebase remote config cache on app update 【发布时间】:2018-08-26 00:23:21 【问题描述】:

当我更新我的应用版本时,firebase 远程配置缓存是否会重置并获取新值或使用现有缓存,直到缓存在设定的时间过期

【问题讨论】:

您好 Rosário,您期望的行为是什么?缓存应该在应用更新时重置? 是的..根据提供的答案看起来不会 你的问题是关于#AskFirebase...酷youtu.be/gvRe-C7ZtDc?t=2m54s 【参考方案1】:

不会的。 它会在缓存超时后获取新值,即使在 App 更新后缓存也会保留。

不过,您可以调用fetch(Long),但超时时间远小于默认值但according to the Google Blog, this might be risky。

如果您编写的代码确定这是更新后的第一个应用程序启动,则可能会使用较小的超时,但while you can reduce this cache time somewhat, if you start making network calls too frequently, your app might start getting throttled, either by the client, or the Remote Config service. (来自上面链接的博客文章)

【讨论】:

以上是关于Android - 应用更新时的 Firebase 远程配置缓存的主要内容,如果未能解决你的问题,请参考以下文章

在 Android 中使用 Google/Facebook 时的 Firebase Auth 重复帐户

我可以使用 Firebase 远程配置来更新 Android 应用的 strings.xml 吗?

如何让我的 android 应用程序连接到实时 firebase 数据库以在实时数据库中创建更新 toast?

添加 Facebook sdk 和 Google Firebase sdk 时的 Android Proguard 问题(重复)

如何使用来自 Firebase Google Maps API Android 的数据更新标记位置

更新 Firebase 中键的值