简体   繁体   English

处理Firebase远程配置崩溃

[英]Handling Firebase Remote Config crashes

I have been working with Firebase remote config for a while in my app, but I notice that when an error data is pushed from Firebase console and app crashes, there is no way you can undo the effect on app crash even after you have corrected the sent data from firebase console. 我在应用程序中使用Firebase远程配置已有一段时间,但是我注意到,当从Firebase控制台推送错误数据而导致应用程序崩溃时,即使更正了错误,也无法撤消对应用程序崩溃的影响从Firebase控制台发送数据。 Unless you clear the App cache from Phone or reinstall again the app will crash on starting. 除非您从手机清除应用程序缓存或重新安装,否则该应用程序将在启动时崩溃。

Please is there a way to handle this issue as it will be a total devastating if someone mistakenly crashes his app from Firebase console, users might not go back through this technicalities. 请提供一种解决此问题的方法,因为如果有人从Firebase控制台错误地崩溃了他的应用程序,那将是彻底的灾难,用户可能不会再使用此技术。

Unless you can arrange for your app to complete a Remote Config fetch, followed by apply of those changes, before the crashing code executes, there's really nothing you can do without publishing a new version of your app that can defend against invalid data coming from Remote Config. 除非您安排应用程序完成Remote Config的提取,然后应用这些更改,否则执行崩溃代码之前 ,如果不发布可以抵御来自Remote的无效数据的新版本应用程序,您将无能为力配置。

You should always be checking for bad data, even if it comes from Remote Config. 您应该始终检查不良数据,即使它们来自Remote Config。 Because people do make mistakes. 因为人们确实会犯错误。

If you are worried about this in the future, maybe you could code up something where you send a Cloud Message to tell your app to force a fetch, then apply the changes immediately, so that next time the app is launched, it can execute without being affected by bad data. 如果您将来担心这个问题,也许您可​​以编写一些代码,在其中发送Cloud Message告诉您的应用强制进行提取,然后立即应用更改,以便下次启动该应用时无需执行受到不良数据的影响。

I am assuming you are using getString() method to get the value of color's hash code. 我假设您正在使用getString()方法来获取颜色的哈希码的值。 Since the key:value pairs in Remote Config are pure strings, we have no way of understanding what is the correct value in your keys. 由于远程配置中的key:value对是纯字符串,因此我们无法理解您的key中正确的值是什么。 Is #ffffff correct or 12345 is correct. #ffffff正确还是12345是正确的。

When fetching non trivial & business critical values, please process them for validation before you use the values in your codebase. 在获取非平凡的和关键业务的值时,请先处理它们以进行验证,然后再在代码库中使用这些值。

That said, bringing data types to Remote Config is on our roadmap. 就是说,将数据类型引入Remote Config是我们的路线图。 It will still not prevent you from making the mistake you mentioned above. 它仍然不会阻止您犯上述错误。

Thanks 谢谢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM