BugScreenSDK

Main SDK class for BugScreen

Initialize in your Application class:

class MyApp : Application() {
override fun onCreate() {
super.onCreate()
BugScreenSDK.start(
BugScreenConfig.Builder(this)
.apiKey("fb_your_api_key")
.screenshotDetection(true)
.debug(BuildConfig.DEBUG)
.build()
)
}
}

Properties

Link copied to clipboard

Check if SDK is initialized

Functions

Link copied to clipboard

Merge data into the existing custom data map. Keys in data overwrite existing values; keys not in data are preserved. The provided map is defensively copied.

Link copied to clipboard

Clear any custom data previously set via setCustomData.

Link copied to clipboard

Get the permission string required for screenshot detection on this device.

Link copied to clipboard

Check if the app has the required permission for screenshot detection.

Link copied to clipboard
fun log(level: LogLevel, message: String)

Log a message that will be included in bug reports. Logs are stored in memory (max 1MB) and sent with bug report submissions.

Link copied to clipboard
fun openBugReportScreen(context: Context, screenshotUri: Uri? = null)

Open the bug report screen.

Link copied to clipboard

Remove a single custom data key from the global map. No-op if key is not present. Other keys are preserved.

Link copied to clipboard
fun requestScreenshotPermission(activity: ComponentActivity, callback: (granted: Boolean) -> Unit)

Request the screenshot detection permission from the user.

Link copied to clipboard

Attach a global map of custom key/value pairs to every subsequent bug report.

Set a single custom data key/value pair on the global map sent with every subsequent bug report. Overwrites the existing value for key if any; other keys are preserved.

Link copied to clipboard

Check if the app should request screenshot detection permission from the user.

Link copied to clipboard

Shutdown the SDK and release resources

Link copied to clipboard

Start the SDK with the given configuration