sentry-dart icon indicating copy to clipboard operation
sentry-dart copied to clipboard

Support screenshot feature (via attachments)

Open marandaneto opened this issue 4 years ago • 11 comments

@bruno-garcia is gonna link to the develop docs (with the specification)

the idea is that basically, it takes a SS when an event is captured and attach it to the event (via attachments). the feature is opt-in and it should be turned on via options.

marandaneto avatar Aug 18 '21 12:08 marandaneto

we can either implement it natively or use a plugin like https://github.com/nusanet/flutter-native-screenshot dependencies are never a good idea though, so let's figure this out.

marandaneto avatar Aug 18 '21 13:08 marandaneto

This can be done kinda easily just in Flutter. That way it's also available for all platforms (except the HTML web based renderer).

See https://api.flutter.dev/flutter/rendering/RenderRepaintBoundary/toImage.html

The drawback is that it requires a bit of manual code by the user.

ueman avatar Aug 18 '21 14:08 ueman

nice, we can add support only for flutter non-web then, but the idea is to add it automatically.

marandaneto avatar Aug 18 '21 14:08 marandaneto

this sounds awesome. between this and widget tree, would it mean we'd have complete lifecycle tracing, right?

tryadelion avatar Sep 09 '21 09:09 tryadelion

this sounds awesome. between this and widget tree, would it mean we'd have complete lifecycle tracing, right?

What exactly do you mean by that? We already have complete lifecycle tracing?

ueman avatar Sep 09 '21 11:09 ueman

not at performance level yet right? unless my pubspec has missed some big update.

tryadelion avatar Sep 09 '21 12:09 tryadelion

Currently in a PR: https://github.com/getsentry/develop/pull/422/

bruno-garcia avatar Sep 09 '21 12:09 bruno-garcia

As this has now been announced here: https://blog.sentry.io/2022/07/07/introducing-mobile-screenshots-and-suspect-commits

This would be really nice to have here as well!

RobertBrunhage avatar Jul 25 '22 04:07 RobertBrunhage

It's mostly done already in https://github.com/getsentry/sentry-dart/pull/576. Someone from Sentry or another OSS contributer just needs to pick it up and finish it. It's not on my priority list at the moment.

ueman avatar Jul 25 '22 08:07 ueman

Any update on this?

AsjadSiddiqui avatar Oct 01 '22 22:10 AsjadSiddiqui

Any update on this?

I'll repeat myself and say

It's mostly done already in https://github.com/getsentry/sentry-dart/pull/576. Someone from Sentry or another OSS contributer just needs to pick it up and finish it. It's not on my priority list at the moment.

So, if you want, you can bring https://github.com/getsentry/sentry-dart/pull/576 up to date with develop, fix any remaining issues and it should be good to go. It shouldn't be too much work, since most of the groundwork is already done.

ueman avatar Oct 02 '22 11:10 ueman

@AsjadSiddiqui We have a PR in the works, so expect an update on this soon(ish).

denrase avatar Oct 25 '22 13:10 denrase

Is this supported in the latest build? The docs says to use attachScreenshoot option, but it seems to not exist in the latest version.

ggirotto avatar Aug 26 '23 13:08 ggirotto

@ggirotto This is supported, you set this boolean flag on the SentryFlutterOptions when initializing the SDK. We do this in the example app in this repository.

denrase avatar Aug 29 '23 07:08 denrase

That's my bad. I was using Sentry.init instead SentryFlutter.init. Thanks for the reply

ggirotto avatar Aug 29 '23 11:08 ggirotto