CrashReporter

external interface CrashReporter(source)

Functions

Link copied to clipboard
abstract external fun addExtraParameter(key: String, value: String)

Set an extra parameter to be sent with the crash report. The values specified here will be sent in addition to any values set via the extra option when start was called. Calling this again with the same key replaces the value. The value is read when a crash happens, so you can update it as your app's state changes.

Link copied to clipboard
abstract external fun getLastCrashReport(): CrashReport?

The date and ID of the crash report with the most recent upload time, from the list returned by getUploadedReports(). If there are no crash reports at all, null is returned.

Link copied to clipboard
abstract external fun getParameters(): ReadonlyRecord<String, String>

The current 'extra' parameters of the crash reporter in the calling process, as set with the extra option and addExtraParameter. Parameters set with the globalExtra option are not included.

Link copied to clipboard
abstract external fun getUploadedReports(): ReadonlyArray<CrashReport>

Returns the crash reports stored on disk. Each report contains the date it was uploaded and the ID that the crash server returned for it.

Link copied to clipboard
abstract external fun getUploadToServer(): Boolean

Whether reports should be submitted to the server. Set through the start method or setUploadToServer.

Link copied to clipboard
abstract external fun removeExtraParameter(key: String)

Remove an extra parameter from the current set of parameters. Future crashes will not include this parameter.

Link copied to clipboard
abstract external fun setUploadToServer(uploadToServer: Boolean)

This would normally be controlled by user preferences. This has no effect if called before start is called.

Link copied to clipboard
abstract external fun start(options: CrashReporterStartOptions)

This method must be called before using any other crashReporter APIs. Once initialized this way, the crashpad handler collects crashes from all subsequently created processes. The crash reporter cannot be disabled once started.