-
Notifications
You must be signed in to change notification settings - Fork 17
Add Crashlytics opt in option #82 #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add Crashlytics opt in option #82 #83
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds an opt-in/opt-out API to enable or disable Firebase Crashlytics data collection at runtime to satisfy privacy/consent requirements (Ticket #82).
- Introduces cross-platform setCollectionEnabled(Boolean) API (common, Android, Apple).
- Adds native iOS interop binding FIRCrashlyticsSetCollectionEnabled.
- Extends no-op EmptyCalls implementation to maintain interface consistency.
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| crashlytics.def | Adds native bridge function FIRCrashlyticsSetCollectionEnabled for iOS interop. |
| CrashlyticsKotlin.kt | Exposes new public API setCollectionEnabled and updates EmptyCalls. |
| CrashlyticsCalls.kt | Extends CrashlyticsCalls interface with setCollectionEnabled. |
| apple CrashlyticsCallsActual.kt | Implements setCollectionEnabled via new native function. |
| android CrashlyticsCallsActual.kt | Implements setCollectionEnabled using FirebaseCrashlytics API. |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| fun sendHandledException(throwable: Throwable) | ||
| fun sendFatalException(throwable: Throwable) | ||
| fun setCustomValue(key: String, value: Any) | ||
| fun setUserId(identifier: String) |
Copilot
AI
Oct 7, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Public API addition lacks KDoc. Please document behavior (default state, when it must be called relative to initialization, effect on pending crash reports) and link to Firebase docs to guide consumers.
| fun setUserId(identifier: String) | |
| fun setUserId(identifier: String) | |
| /** | |
| * Enables or disables automatic collection of crash reports. | |
| * | |
| * By default, crash report collection is enabled. Call this method to disable or enable | |
| * collection at runtime. This method should be called as early as possible, before any | |
| * crash events occur, ideally during app initialization. | |
| * | |
| * Disabling collection will prevent new crash reports from being sent to Firebase. | |
| * Pending crash reports that have not yet been sent will remain on the device until | |
| * collection is re-enabled. | |
| * | |
| * For more information, see the Firebase documentation: | |
| * https://firebase.google.com/docs/crashlytics/disable-crash-reporting | |
| * | |
| * @param enabled true to enable crash report collection, false to disable. | |
| */ |
Add the option to enable/disable Crashlytics on demand.
This is commonly needed for high privacy standards. It allows you to start data collection only after the user explicitly opted-in. And you could offer the user a setting to disable the collection again in their settings.
Google documentation: https://firebase.google.com/docs/crashlytics/customize-crash-reports?platform=ios&hl=en#enable-reporting
Closes Ticket #82