gpt4 book ai didi

ios - 在 iOS 应用程序运行时启用/禁用 Crashlytics

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:58:50 24 4
gpt4 key购买 nike

似乎无法通过 swift 中的方法调用在运行时启用/禁用 Crashlytics - 我的应用程序设置了 firebase 分析和 Crashlytics for firebase - 以下调用(根据 Google dev website )给我“使用未解析的标识符 'Crash'”,即使在导入 crashlytics 和 firebase 时也是如此

Crash.sharedInstance().crashCollectionEnabled = false

最佳答案

在新的 SDK 中,您可以按照 documentation 进行操作:

By default, Crashlytics automatically collects crash reports for allyour app's users. To give users more control over the data they send,you can enable opt-in reporting for your users by disabling automaticcollection and initializing Crashlytics only for selected users:

Turn off automatic collection by adding a new key to your Info.plistfile:

Key: FirebaseCrashlyticsCollectionEnabled 
Value: false

Enable collection for select users by calling the Crashlytics data collectionoverride at runtime. The override value persists across launches ofyour app so Crashlytics can automatically collect reports for futurelaunches of that app instance. To opt out of automatic crashreporting, pass false as the override value.

 Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(true)

关于ios - 在 iOS 应用程序运行时启用/禁用 Crashlytics,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56421527/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com