React Native Firebase
    Preparing search index...

    Crashlytics module instance - returned from firebase.crashlytics() or firebase.app().crashlytics()

    interface Crashlytics {
        app: ReactNativeFirebase.FirebaseApp;
        isCrashlyticsCollectionEnabled: boolean;
        checkForUnsentReports(): Promise<boolean>;
        crash(): void;
        deleteUnsentReports(): Promise<void>;
        didCrashOnPreviousExecution(): Promise<boolean>;
        log(message: string): void;
        recordError(error: Error, jsErrorName?: string): void;
        sendUnsentReports(): void;
        setAttribute(name: string, value: string): Promise<null>;
        setAttributes(attributes: { [key: string]: string }): Promise<null>;
        setCrashlyticsCollectionEnabled(enabled: boolean): Promise<null>;
        setUserId(userId: string): Promise<null>;
    }

    Hierarchy (View Summary)

    Index

    Methods

    • Determines whether there are any unsent crash reports cached on the device. The callback only executes if automatic data collection is disabled.

      Returns Promise<boolean>

      Error if Crashlytics collection is enabled (reports are automatically sent)

    • 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.

      Returns void

    • Deletes any unsent reports on the device. This method only applies if automatic data collection is disabled.

      Returns Promise<void>

    • Returns a boolean value indicating whether the app crashed during the previous execution.

      Returns Promise<boolean>

    • Log a message that will appear in any subsequent Crash or Non-fatal error reports.

      Parameters

      • message: string

        The message to log.

      Returns void

    • Record a JavaScript Error.

      The JavaScript stack trace is converted into a mock native iOS or Android exception before submission.

      Parameters

      • error: Error

        Expects an instance of Error; e.g. classes that extend Error will also be supported.

      • OptionaljsErrorName: string

        Optional string containing Javascript error name

      Returns void

    • Enqueues any unsent reports on the device to upload to Crashlytics. This method only applies if automatic data collection is disabled.

      Returns void

    • Sets a string value to be associated with the given attribute name which will be visible in the Firebase Crashlytics console.

      Parameters

      • name: string

        The name of the attribute to set.

      • value: string

        A string value for the given attribute.

      Returns Promise<null>

    • Like setAttribute but for multiple attributes.

      Parameters

      • attributes: { [key: string]: string }

        An object of key/value attribute name and values.

      Returns Promise<null>

    • Enable/disable Crashlytics reporting.

      Use this for opt-in first user data collection flows combined with firebase.json settings to disable auto collection.

      Parameters

      • enabled: boolean

        A boolean value representing whether to enable Crashlytics error collection.

      Returns Promise<null>

    • Specify a user identifier which will be visible in the Firebase Crashlytics console.

      It is recommended for privacy purposes that this value be a value that's meaningless to a third-party observer; such as an arbitrary string that ties an end-user to a record in your system e.g. a database record id.

      Parameters

      • userId: string

        An arbitrary string that ties an end-user to a record in your system e.g. a database record id.

      Returns Promise<null>

    Properties

    The FirebaseApp this module is associated with

    isCrashlyticsCollectionEnabled: boolean

    Whether Crashlytics reporting is enabled.