HomeDocsAndroidCustom data

Custom data

v1.7.1

Attach your own context to every bug report.

Attach arbitrary key/value pairs to every subsequent bug report:

kotlin
import app.bugscreen.android.BugScreenSDK

// Replace the whole map:
BugScreenSDK.setCustomData(mapOf(
    "env" to "staging",
    "buildType" to "debug",
    "userTier" to "pro",
))

// Set or remove a single key:
BugScreenSDK.setCustomData("userId", "abc-123")
BugScreenSDK.removeCustomData("userId")

// Merge a map without replacing existing keys:
BugScreenSDK.addCustomData(mapOf("plan" to "pro", "region" to "eu"))

// Remove all custom data:
BugScreenSDK.clearCustomData()

Call any time after start(). The values are read when the bug report screen opens and appear in the report's metadata.