Can't seem to enable/disable Crashlytics at runtime by a method call in swift - my app is setup with firebase analytics and Crashlytics for firebase - the following call (per the Google dev website) gives me "Use of unresolved identifier 'Crash'" even when importing crashlytics and firebase
Crash.sharedInstance().crashCollectionEnabled = false
Each user would need to head to their Firebase console and click on the Alert tab or use this link: https://firebase.google.com/u/0/subscriptions/overview Select the project and then turn off emails for Crashlytics.
Step 1: Add the Crashlytics SDK to your app Use Swift Package Manager to install and manage Firebase dependencies. Visit our installation guide to learn about the different ways you can add Firebase SDKs to your Apple project, including importing frameworks directly and using CocoaPods.
Firebase Crashlytics is a lightweight, realtime crash reporter that helps you track, prioritize, and fix stability issues that erode your app quality. Crashlytics saves you troubleshooting time by intelligently grouping crashes and highlighting the circumstances that lead up to them.
Firebase Crashlytics, a real time crash reporting tool, helps you prioritize and fix your most pervasive crashes based on the impact on real users. Crashlytics also easily integrates into your Android, iOS, macOS, tvOS, and watchOS apps.
In new SDK you can do it as per documentation:
By default, Crashlytics automatically collects crash reports for all your app's users. To give users more control over the data they send, you can enable opt-in reporting for your users by disabling automatic collection and initializing Crashlytics only for selected users:
Turn off automatic collection by adding a new key to your Info.plist file:
Key: FirebaseCrashlyticsCollectionEnabled
Value: false
Enable collection for select users by calling the Crashlytics data collection override at runtime. The override value persists across launches of your app so Crashlytics can automatically collect reports for future launches of that app instance. To opt out of automatic crash reporting, pass false as the override value.
Crashlytics.crashlytics().setCrashlyticsCollectionEnabled(true)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With