Skip to content

Commit

Permalink
[v9]: Remove screenshot option attachScreenshotOnlyWhenResumed (#2664)
Browse files Browse the repository at this point in the history
  • Loading branch information
denrase authored Feb 10, 2025
1 parent 5bf38c2 commit 496768f
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 14 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## Unreleased 9.0.0

- Increase minimum SDK version requirements to Dart v3.5.0 and Flutter v3.24.0 ([#2643](https://github.com/getsentry/sentry-dart/pull/2643))
- Remove screenshot option `attachScreenshotOnlyWhenResumed` ([#2664](https://github.com/getsentry/sentry-dart/pull/2664))
- Remove deprecated `beforeScreenshot` ([#2662](https://github.com/getsentry/sentry-dart/pull/2662))

### Dependencies
Expand Down
10 changes: 0 additions & 10 deletions flutter/lib/src/event_processor/screenshot_event_processor.dart
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import 'dart:async';
import 'dart:typed_data';
import 'dart:ui';

import 'package:meta/meta.dart';
import '../../sentry_flutter.dart';
import '../renderer/renderer.dart';
import '../screenshot/recorder.dart';
import '../screenshot/recorder_config.dart';
import 'package:flutter/widgets.dart' as widget;

import '../utils/debouncer.dart';

Expand Down Expand Up @@ -103,14 +101,6 @@ class ScreenshotEventProcessor implements EventProcessor {
return event;
}

if (_options.attachScreenshotOnlyWhenResumed &&
widget.WidgetsBinding.instance.lifecycleState !=
AppLifecycleState.resumed) {
_options.logger(SentryLevel.debug,
'Only attaching screenshots when application state is resumed.');
return event;
}

final screenshotData = await createScreenshot();
if (screenshotData != null) {
hint.screenshot = SentryAttachment.fromScreenshotData(screenshotData);
Expand Down
4 changes: 0 additions & 4 deletions flutter/lib/src/sentry_flutter_options.dart
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,6 @@ class SentryFlutterOptions extends SentryOptions {
/// The quality of the attached screenshot
SentryScreenshotQuality screenshotQuality = SentryScreenshotQuality.high;

/// Only attach a screenshot when the app is resumed.
/// See https://docs.sentry.io/platforms/flutter/troubleshooting/#screenshot-integration-background-crash
bool attachScreenshotOnlyWhenResumed = false;

/// Sets a callback which is executed before capturing screenshots. Only
/// relevant if `attachScreenshot` is set to true. When false is returned
/// from the function, no screenshot will be attached.
Expand Down

0 comments on commit 496768f

Please sign in to comment.