Skip to main content

Lifecycle events (Beta)

Bugsee SDK works silently within your app, recording everything to assist debugging. Lifecycle events let you be notified about internal state changes and important events within the SDK.

Implementing callback

Bugsee.setLifecycleEventsListener { event ->
when (event) {
BugseeLifecycleEvent.Launched -> println("Bugsee launched")
BugseeLifecycleEvent.ReportUploadFailed -> println("Report upload failed")
else -> println("Bugsee event: $event")
}
}

Available lifecycle events

NameDescription
LaunchedBugsee was successfully launched
StartedBugsee started after being stopped
StoppedBugsee was stopped
ResumedRecording resumed after being paused
PausedRecording was paused
RelaunchedAfterCrashBugsee launched with a pending crash report (app was relaunched after crash)
BeforeReportShownAbout to show the reporting UI
AfterReportShownReporting UI is shown
BeforeReportUploadedReport is about to be uploaded
AfterReportUploadedReport was successfully uploaded
BeforeFeedbackShownAbout to show the feedback controller
AfterFeedbackShownFeedback controller is shown
BeforeReportAssembledReport is about to be assembled
AfterReportAssembledReport was assembled
ReportUploadFailedWithFutureRetryUpload failed, will retry later
ReportUploadFailedUpload failed permanently

Pause and resume

Temporarily pause and resume Bugsee recording:

Bugsee.pause()

// ... later
Bugsee.resume()

Stop and relaunch

Completely stop or restart the SDK:

Bugsee.stop()

// Check if running
val isRunning = Bugsee.isLaunched()

// Relaunch with the same configuration
Bugsee.relaunch()

// Relaunch with new options
Bugsee.relaunch(BugseeLaunchOptions().apply {
videoEnabled = false
})

Data cleanup

Delete all collected data stored on the device:

Bugsee.deleteCollectedDataOnDevice { success ->
println("Data deleted: $success")
}