Bug Screen SDK
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()
)
}
}Functions
Clear any custom data previously set via setCustomData.
Clear any account set via setUser or setUserProvider. Subsequent reports carry no account until one is set again.
Get the permission string required for screenshot detection on this device.
Check if the app has the required permission for screenshot detection.
Open the bug report screen.
Remove a single custom data key from the global map. No-op if key is not present. Other keys are preserved.
Request the screenshot detection permission from the user.
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.
Identify the account the report is filed under. The reporter's login is the first thing a triager needs to reproduce a bug, so the backend renders it as a dedicated Account section at the top of the created issue and promotes role to a filterable label.
Supply the account lazily. The provider is invoked at capture time (when the report screen opens), not when you register it — so the attached account always reflects the current session and never a stale value from a previous login. This is the primitive setUser is sugar over; registering a provider clears any static user previously set.
Check if the app should request screenshot detection permission from the user.
Start the SDK with the given configuration