Skip to content

Silent bug-report invocation

Silent invocation uploads a bug report directly instead of presenting Appelium's report form. It is useful for a customer-support action, an app-detected failure state or a clearly labelled custom reporting UI.

Bug reporting must be enabled. invokeSilently is a suspending function: it captures the current activity log, optionally a screenshot, the configured bug-report attachment and the current activity, then uploads the report. It does not present Appelium UI or include the automatic screen recording shown in the interactive flow.

import com.appelium.feedback.invokeSilently
import com.appelium.feedback.networking.NetworkRequestException

fun sendSupportReport() {
    lifecycleScope.launch {
        try {
            AppeliumFeedback.invokeSilently(
                reporterEmail = currentUserEmail,
                title = "Checkout support report"
            )
            showConfirmation()
        } catch (exception: NetworkRequestException) {
            showUploadError(exception.message)
        }
    }
}

Both arguments are optional:

  • title identifies the report in the Dashboard;
  • reporterEmail stores the reporter contact only if the application intentionally supplies it. It is not used to prefill the next report's form, and an invalid address is left out.

Do not call silent invocation automatically from ordinary recoverable events without a clear user expectation. It uploads diagnostics and counts toward bug-report data.

Capture useful context

Write the relevant state before invoking:

AppeliumFeedback.Log.w(message = "Checkout entered recovery flow after timeout", tag = "Checkout")

try {
    AppeliumFeedback.invokeSilently(title = "Checkout timeout: recovery flow")
} catch (exception: NetworkRequestException) {
    // Handle the upload failure in the app's own UI.
}

Use the title for a stable human-readable summary. Put transient values and structured context into Appelium logs rather than generating a unique title for every request.

Add screenshots and custom attachments

Silent invocation uses the screenshotsEnabled setting from BugReportingConfiguration.Enabled. The screenshot shows the activity in the foreground; without one, the report is sent without a screenshot. It also calls the configured BugReportingDelegate attachment, so the same file can be added to interactive and silent reports.

Keep the attachment small and redact personal or secret values. See Attachments for the SDK's 100,000-byte limit and safe loading examples.

Disable automatic gestures

Silent invocation is a different control from the shake gesture. If the app only reports through its own UI, disable invocation events during initialization:

AppeliumFeedback.start(
    apiKey = "YOUR_API_KEY",
    application = this,
    bugReporting = BugReportingConfiguration.Enabled(invocationEvents = emptySet())
)

If the configuration should still support shake or another invocation event, do not pass an empty set.

Handle failure

invokeSilently throws a NetworkRequestException when the upload fails, for example because the device is offline or the API key is invalid. Show your own error message or offer a retry.

If bug reporting is not enabled in start, or the SDK has not been started, the call returns without sending anything and without throwing. Check the start call if reports do not arrive.