Skip to content

Commit dd72b44

Browse files
committed
improve docs
1 parent a40a687 commit dd72b44

File tree

2 files changed

+15
-21
lines changed

2 files changed

+15
-21
lines changed

docs/platforms/flutter/configuration/releases.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ Monitor the [health of releases](/product/releases/health/) by observing user ad
6464

6565
<Note>
6666

67-
Crash reporting and app hang detection are not available for watchOS.
67+
Release health is only available for Android and iOS and macOS.
6868

6969
</Note>
7070

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,23 @@
11
To benefit from the health data, you must use at least version 4.0.0 of the Flutter SDK.
22

3-
By default, the session is terminated once the application is in the background for more than 30 seconds. You can change the time out with the option named `sessionTrackingIntervalMillis`. It takes the amount in milliseconds. For example, to configure it to be 60 seconds:
3+
### Session Timeout
44

5-
```dart
6-
import 'package:flutter/widgets.dart';
7-
import 'package:sentry_flutter/sentry_flutter.dart';
5+
By default, the session is terminated once the application is in the background for more than `30 seconds`. You can change the default timeout with the option `autoSessionTrackingInterval` to a Duration of your choosing.
86

9-
Future<void> main() async {
10-
await SentryFlutter.init(
11-
(options) => options.autoSessionTrackingInterval = const Duration(milliseconds: 60000)
12-
appRunner: () => runApp(MyApp()),
13-
);
14-
}
7+
```dart
8+
SentryFlutter.init((options) {
9+
// Change timeout duration until session is terminated in background
10+
options.autoSessionTrackingInterval = const Duration(seconds: 60)
11+
}, appRunner: () => runApp(MyApp()));
1512
```
1613

17-
If you'd like to opt out of this feature, you can do so using options.
14+
### Disable Auto Session Tracking
1815

19-
```dart
20-
import 'package:flutter/widgets.dart';
21-
import 'package:sentry_flutter/sentry_flutter.dart';
16+
If you'd like to opt out of capturing sessions, set the option `enableAutoSessionTracking` to `false`.
2217

23-
Future<void> main() async {
24-
await SentryFlutter.init(
25-
(options) => options.enableAutoSessionTracking = true, // it's enabled by default
26-
appRunner: () => runApp(MyApp()),
27-
);
28-
}
18+
```dart
19+
SentryFlutter.init((options) {
20+
// Disable auto session tracking
21+
options.enableAutoSessionTracking = false;
22+
}, appRunner: () => runApp(MyApp()));
2923
```

0 commit comments

Comments
 (0)