简体   繁体   English

如何在 iOS 中的应用程序处于后台状态时禁用崩溃报告

[英]How to disable crash reporting in while app is in background state in iOS

Firebase crashlytics is integrated into my application and working fine. Firebase crashlytics 已集成到我的应用程序中并且运行良好。 I am experiencing crashes while the app is in the background and I wanted to disable these crash reporting but other crashes must be reported.我在应用程序处于后台时遇到崩溃,我想禁用这些崩溃报告,但必须报告其他崩溃。

Follow the instructions from:按照以下说明操作:

enabling/disabling Crashlytics at runtime in iOS app 在 iOS 应用程序中在运行时启用/禁用 Crashlytics

Add this key value to your info.plist:将此键值添加到您的 info.plist 中:

Key: FirebaseCrashlyticsCollectionEnabled 
Value: false 

You can then manually enable or disable crash reporting by using this method:然后,您可以使用以下方法手动启用或禁用崩溃报告:

 Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(true)

So now you can enable Crashlytics when the app is launched, disable it when applicationDidEnterBackground is triggered and re-enable it when applicationWillEnterForeground is trigerred.所以,现在你可以启用Crashlytics当应用程序启动时,禁用它applicationDidEnterBackground被触发时,当applicationWillEnterForeground是trigerred重新启用它。

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

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