crashlytics
The Firebase Crashlytics service interface.
This module is available for the default app only.
Example
Get the Crashlytics service for the default app:
const defaultAppCrashlytics = firebase.crashlytics();
Properties
isCrashlyticsCollectionEnabled
</>Whether Crashlytics reporting is enabled.
isCrashlyticsCollectionEnabled: true;
Methods
checkForUnsentReports
</>Determines whether there are any unsent crash reports cached on the device. The callback only executes if automatic data collection is disabled.
checkForUnsentReports(): Promise<boolean>;
crash
</>Cause your app to crash for testing purposes. This is a native crash and will not contain a javascript stack trace. Note that crashes are intercepted by debuggers on iOS so no report will be seen under those conditions. Additionally if it is a debug build you will need to ensure your firebase.json is configured to enable crashlytics even in debug mode.
crash(): void;
deleteUnsentReports
</>Deletes any unsent reports on the device. This method only applies if automatic data collection is disabled.
deleteUnsentReports(): Promise<void>;
didCrashOnPreviousExecution
</>Returns a boolean value indicating whether the app crashed during the previous execution.
didCrashOnPreviousExecution(): Promise<boolean>;
log
</>Log a message that will appear in any subsequent Crash or Non-fatal error reports.
log(message: string): void;
recordError
</>Record a JavaScript Error.
recordError(error: Error, jsErrorName?: undefined | string): void;
sendUnsentReports
</>Enqueues any unsent reports on the device to upload to Crashlytics. This method only applies if automatic data collection is disabled.
sendUnsentReports(): void;
setAttribute
</>Sets a string value to be associated with the given attribute name which will be visible in the Firebase Crashlytics console.
setAttribute(name: string, value: string): Promise<null>;
setAttributes
</>Like setAttribute
but for multiple attributes.
setAttributes(attributes: { [key: string]: string }): Promise<null>;