Skip to content

Commit e2d89fc

Browse files
authored
Add missing props (#1354)
1 parent 89ea268 commit e2d89fc

File tree

7 files changed

+43
-25
lines changed

7 files changed

+43
-25
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/main/CHANGELOG.md#832)
99
- [diff](https://github.com/getsentry/sentry-cocoa/compare/8.3.1...8.3.2)
1010

11+
## Fixes
12+
13+
- Sync missing properties to the Native SDKs ([#1354](https://github.com/getsentry/sentry-dart/pull/1354))
14+
1115
## 7.2.0
1216

1317
### Features

flutter/android/src/main/kotlin/io/sentry/flutter/SentryFlutterPlugin.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,8 @@ class SentryFlutterPlugin : FlutterPlugin, MethodCallHandler, ActivityAware {
166166

167167
args.getIfNotNull<Boolean>("sendClientReports") { options.isSendClientReports = it }
168168

169+
args.getIfNotNull<Long>("maxAttachmentSize") { options.maxAttachmentSize = it }
170+
169171
val name = "sentry.java.android.flutter"
170172

171173
var sdkVersion = options.sdkVersion

flutter/ios/Classes/SentryFlutterPluginApple.swift

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -313,18 +313,12 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
313313
options.dist = dist
314314
}
315315

316-
if let enableAutoNativeBreadcrumbs = arguments["enableAutoNativeBreadcrumbs"] as? Bool,
317-
enableAutoNativeBreadcrumbs == false {
318-
options.integrations = options.integrations?.filter { (name) -> Bool in
319-
name != "SentryAutoBreadcrumbTrackingIntegration"
320-
}
316+
if let enableAutoNativeBreadcrumbs = arguments["enableAutoNativeBreadcrumbs"] as? Bool {
317+
options.enableAutoBreadcrumbTracking = false
321318
}
322319

323-
if let enableNativeCrashHandling = arguments["enableNativeCrashHandling"] as? Bool,
324-
enableNativeCrashHandling == false {
325-
options.integrations = options.integrations?.filter { (name) -> Bool in
326-
name != "SentryCrashIntegration"
327-
}
320+
if let enableNativeCrashHandling = arguments["enableNativeCrashHandling"] as? Bool {
321+
options.enableCrashHandler = false
328322
}
329323

330324
if let maxBreadcrumbs = arguments["maxBreadcrumbs"] as? UInt {
@@ -346,6 +340,18 @@ public class SentryFlutterPluginApple: NSObject, FlutterPlugin {
346340
if let sendClientReports = arguments["sendClientReports"] as? Bool {
347341
options.sendClientReports = sendClientReports
348342
}
343+
344+
if let maxAttachmentSize = arguments["maxAttachmentSize"] as? UInt {
345+
options.maxAttachmentSize = maxAttachmentSize
346+
}
347+
348+
if let captureFailedRequests = arguments["captureFailedRequests"] as? Bool {
349+
options.enableCaptureFailedRequests = captureFailedRequests
350+
}
351+
352+
if let enableAppHangTracking = arguments["enableAppHangTracking"] as? Bool {
353+
options.enableAppHangTracking = enableAppHangTracking
354+
}
349355
}
350356

351357
private func logLevelFrom(diagnosticLevel: String) -> SentryLevel {

flutter/lib/src/integrations/native_sdk_integration.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,10 @@ class NativeSdkIntegration extends Integration<SentryFlutterOptions> {
4545
'enableNdkScopeSync': options.enableNdkScopeSync,
4646
'enableAutoPerformanceTracing': options.enableAutoPerformanceTracing,
4747
'sendClientReports': options.sendClientReports,
48-
'sdk': {
49-
'name': options.sdk.name,
50-
'version': options.sdk.version,
51-
},
5248
'proguardUuid': options.proguardUuid,
49+
'maxAttachmentSize': options.maxAttachmentSize,
50+
'captureFailedRequests': options.captureFailedRequests,
51+
'enableAppHangTracking': options.enableAppHangTracking,
5352
});
5453

5554
options.sdk.addIntegration('nativeSdkIntegration');

flutter/lib/src/sentry_flutter_options.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ class SentryFlutterOptions extends SentryOptions {
194194
@experimental
195195
bool attachViewHierarchy = false;
196196

197+
/// When enabled, the SDK tracks when the application stops responding for a
198+
/// specific amount of time (default 2s).
199+
/// Only available on iOS and macOS.
200+
bool enableAppHangTracking = true;
201+
197202
/// By using this, you are disabling native [Breadcrumb] tracking and instead
198203
/// you are just tracking [Breadcrumb]s which result from events available
199204
/// in the current Flutter environment.

flutter/test/integrations/init_native_sdk_integration_test.dart

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,10 @@ void main() {
5656
'enableNdkScopeSync': true,
5757
'enableAutoPerformanceTracing': true,
5858
'sendClientReports': true,
59-
'sdk': {
60-
'name': 'sentry.dart.flutter',
61-
'version': sdkVersion,
62-
},
63-
'proguardUuid': null
59+
'proguardUuid': null,
60+
'maxAttachmentSize': 20 * 1024 * 1024,
61+
'captureFailedRequests': true,
62+
'enableAppHangTracking': true,
6463
});
6564
});
6665

@@ -94,7 +93,10 @@ void main() {
9493
..enableAutoPerformanceTracing = false
9594
..sendClientReports = false
9695
..enableNdkScopeSync = true
97-
..proguardUuid = fakeProguardUuid;
96+
..proguardUuid = fakeProguardUuid
97+
..maxAttachmentSize = 10
98+
..captureFailedRequests = false
99+
..enableAppHangTracking = false;
98100

99101
options.sdk.addIntegration('foo');
100102
options.sdk.addPackage('bar', '1');
@@ -131,11 +133,10 @@ void main() {
131133
'enableNdkScopeSync': true,
132134
'enableAutoPerformanceTracing': false,
133135
'sendClientReports': false,
134-
'sdk': {
135-
'name': 'sentry.dart.flutter',
136-
'version': sdkVersion,
137-
},
138-
'proguardUuid': fakeProguardUuid
136+
'proguardUuid': fakeProguardUuid,
137+
'maxAttachmentSize': 10,
138+
'captureFailedRequests': false,
139+
'enableAppHangTracking': false,
139140
});
140141
});
141142

min_version_test/lib/main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ class _MyHomePageState extends State<MyHomePage> {
163163
),
164164
Text(
165165
'$_counter',
166+
// ignore: deprecated_member_use
166167
style: Theme.of(context).textTheme.headline4,
167168
),
168169
],

0 commit comments

Comments
 (0)