Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

enabling/disabling Crashlytics at runtime in iOS app

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
like image 702
Nostradamus Avatar asked Jun 03 '19 05:06

Nostradamus


People also ask

How do I turn off Crashlytics?

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.

How do you integrate Crashlytics in iOS app?

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.

Why Crashlytics is integrated with your app?

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.

Is Crashlytics real time?

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.


1 Answers

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)
like image 198
Irina Avatar answered Oct 09 '22 01:10

Irina