Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

attach screenshots only when crash happens #2665

Closed
kasogg opened this issue Apr 20, 2023 · 4 comments
Closed

attach screenshots only when crash happens #2665

kasogg opened this issue Apr 20, 2023 · 4 comments
Assignees
Labels
enhancement New feature or request Platform: Android

Comments

@kasogg
Copy link

kasogg commented Apr 20, 2023

Problem Statement

Is there a way to attach screenshots only in crash issues? Custom exception do not need to attach screenshots.

Solution Brainstorm

Add an option in SentryAndroidOptions.

No response

@hu441444238xin
Copy link

My question is similar

Can the screenshot function be reported based on custom scenarios?Not necessarily

@romtsn
Copy link
Member

romtsn commented Apr 21, 2023

For the moment, you can drop screenshots for non-crashed events via beforeSend:

SentryAndroid.init(context) { options ->
    options.beforeSend = SentryOptions.BeforeSendCallback { event, hint ->
        if (!event.isCrashed) {
            hint.screenshot = null
        }
        event       
    }
}

We're discussing internally whether we want to introduce a new option for capturing screenshots for handled events, but no decision yet.

@hu441444238xin what custom scenarios do you have in mind? Would like to better understand them before suggesting anything.

@markushi
Copy link
Member

Hi @kasogg @hu441444238xin I have good news for you: We've added support for customizing the capture behavior with the upcoming 6.24.0 release of our SDK. The docs also illustrate on how your use-case can be supported.

@github-project-automation github-project-automation bot moved this from In Progress to Done in Mobile & Cross Platform SDK Jun 22, 2023
@hu441444238xin
Copy link

hu441444238xin commented Jun 22, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Platform: Android
Projects
Archived in project
Development

No branches or pull requests

5 participants