defold/extension-firebase-crashlytics/firebase-crashlytics
Functions and constants for interacting with Firebase
- GitHub: defold/extension-firebase-crashlytics — pinned to
1.0.3(released while Defold 1.13.1 was current)- Pick a release from defold/extension-firebase-crashlytics releases and add its Source code (zip) URL (or a packaged
.zipasset, if the library ships one) togame.projectunder[project]dependencies, then Fetch Libraries in the Defold editor. - Run
bunx @defold-typescript/cli resolveto materialize its types. - Import it under a namespace alias of your choice:
import * as firebase from "firebase"
- Pick a release from defold/extension-firebase-crashlytics releases and add its Source code (zip) URL (or a packaged
Functions
firebase.crashlytics.initialize(): booleanfirebase.crashlytics.set_enabled(enabled: boolean)firebase.crashlytics.is_enabled(): booleanfirebase.crashlytics.did_crash_on_previous_execution(): booleanfirebase.crashlytics.send_unsent_reports()firebase.crashlytics.delete_unsent_reports()firebase.crashlytics.set_user_id(user_id: string)firebase.crashlytics.set_custom_key(key: string, value: string | number | boolean)firebase.crashlytics.log(message: string)firebase.crashlytics.record_exception(message: string)firebase.crashlytics.record_lua_error(message: string, traceback: string | nil)firebase.crashlytics.test_java_crash()firebase.crashlytics.test_native_crash()
firebase.crashlytics.initialize(): boolean
Initializes Crashlytics and returns true if the core Firebase extension is available and the default FirebaseApp has been initialized. After successful initialization, Defold dmLogWarning messages are automatically added as Crashlytics logs for subsequent reports.
Returns
initialized:boolean— True if Crashlytics was initialized.
firebase.crashlytics.set_enabled(enabled: boolean)
Sets whether Crashlytics collection is enabled for this app on this device.
Parameters
enabled:boolean— True to enable Crashlytics collection.
firebase.crashlytics.is_enabled(): boolean
Returns whether Crashlytics collection is enabled.
Returns
enabled:boolean— True if Crashlytics collection is enabled.
firebase.crashlytics.did_crash_on_previous_execution(): boolean
Returns whether the app crashed during the previous execution.
Returns
crashed:boolean— True if a crash was recorded during the previous execution.
firebase.crashlytics.send_unsent_reports()
Sends queued crash reports when automatic collection is disabled.
firebase.crashlytics.delete_unsent_reports()
Deletes queued crash reports when automatic collection is disabled.
firebase.crashlytics.set_user_id(user_id: string)
Sets the user ID associated with subsequent fatal, non-fatal, and ANR reports.
Parameters
user_id:string— User identifier.
firebase.crashlytics.set_custom_key(key: string, value: string | number | boolean)
Sets a string, number, or boolean custom key for subsequent fatal, non-fatal, and ANR reports.
Parameters
key:string— Custom key name.value:string | number | boolean— String, number, or boolean value.
firebase.crashlytics.log(message: string)
Logs a message that is included in the next fatal, non-fatal, or ANR report.
Parameters
message:string— Log message.
firebase.crashlytics.record_exception(message: string)
Records a non-fatal exception with the supplied message.
Parameters
message:string— Exception message.
firebase.crashlytics.record_lua_error(message: string, traceback: string | nil)
Records a Lua runtime error as a non-fatal exception with parsed Lua stack frames when a traceback is supplied.
Parameters
message:string— Lua error message.traceback:string | nil— Lua traceback string, typically supplied by sys.set_error_handler. May be nil or omitted.
firebase.crashlytics.test_java_crash()
Forces a Java crash for Crashlytics setup testing. Android only.
firebase.crashlytics.test_native_crash()
Forces a native crash for Crashlytics setup testing.