简体   繁体   English

如何以编程方式在 iOS 上的当前 Crashlytics (3.14.*) / Firebase (1.10.*) 中禁用 CrashReporting

[英]How to programmatically disable CrashReporting in current Crashlytics (3.14.*) / Firebase (1.10.*) on iOS

I'd like to enable and disable Crash Reporting in my current iOS app programmatically.我想以编程方式在我当前的 iOS 应用程序中启用和禁用崩溃报告。 I'm using我在用着

  • Crashlytics: 3.14.0崩溃分析:3.14.0
  • Fabric: 1.10.2面料:1.10.2
  • Firebase (Core / Analytics): 6.9.0 Firebase(核心/分析):6.9.0

The official Firebase documentation at https://firebase.google.com/docs/crash/disable-sdk?hl=en tells me to use the following code: https://firebase.google.com/docs/crash/disable-sdk?hl=en的官方 Firebase 文档告诉我使用以下代码:

Crash.sharedInstance().crashCollectionEnabled = false

But this doesn't work / seems to be outdated as但这不起作用/似乎已经过时了

  1. There's no Crash-Class or -Symbol.没有 Crash-Class 或 -Symbol。
  2. There's a Crashlytics class, which seems to be the new Crash-class, but it doesn't have a crashCollectionEnabled property有一个 Crashlytics class,它似乎是新的 Crash 类,但它没有crashCollectionEnabled属性
  3. There seems to be no other API in Crashlytics / Fabric / Firebase to achieve this Crashlytics / Fabric / Firebase 中似乎没有其他 API 可以实现此目的

I know I could write a custom exception handler and forward received exceptions on demand to Crashlytics, but I don't want to implement such a dirty solution.我知道我可以编写一个自定义异常处理程序并按需将收到的异常转发给 Crashlytics,但我不想实现这样一个肮脏的解决方案。

Does anybody know a clean way of enabling / disabling Crashlytics in a running iOS app?有人知道在运行的 iOS 应用程序中启用/禁用 Crashlytics 的干净方法吗?

for Fabric/Crashlytics: don't call this:对于 Fabric/Crashlytics:不要这样称呼:

Fabric.with([Crashlytics.self])

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

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