Skip to content

Conversation

@michaeltroger
Copy link

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

@samhill303 samhill303 requested a review from Copilot October 7, 2025 19:38
Copy link

Copilot AI left a 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)
Copy link

Copilot AI Oct 7, 2025

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.

Suggested change
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.
*/

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants