diff --git a/flutter/lib/src/native/cocoa/sentry_native_cocoa.dart b/flutter/lib/src/native/cocoa/sentry_native_cocoa.dart index dd90997a2..b2f420e42 100644 --- a/flutter/lib/src/native/cocoa/sentry_native_cocoa.dart +++ b/flutter/lib/src/native/cocoa/sentry_native_cocoa.dart @@ -1,3 +1,4 @@ +import 'dart:async'; import 'dart:ffi'; import 'dart:typed_data'; import 'dart:ui'; @@ -5,6 +6,7 @@ import 'dart:ui'; import 'package:meta/meta.dart'; import '../../../sentry_flutter.dart'; +import '../../replay/replay_config.dart'; import '../../screenshot/recorder.dart'; import '../../screenshot/recorder_config.dart'; import '../sentry_native_channel.dart'; @@ -68,6 +70,11 @@ class SentryNativeCocoa extends SentryNativeChannel { return super.init(hub); } + @override + FutureOr setReplayConfig(ReplayConfig config) { + // Note: unused on iOS. + } + @override int? startProfiler(SentryId traceId) => tryCatchSync('startProfiler', () { final cSentryId = cocoa.SentryId1.alloc(_lib) diff --git a/flutter/lib/src/native/sentry_native_channel.dart b/flutter/lib/src/native/sentry_native_channel.dart index 759daa95c..0fc1435b4 100644 --- a/flutter/lib/src/native/sentry_native_channel.dart +++ b/flutter/lib/src/native/sentry_native_channel.dart @@ -221,7 +221,7 @@ class SentryNativeChannel bool get supportsReplay => false; @override - Future setReplayConfig(ReplayConfig config) => + FutureOr setReplayConfig(ReplayConfig config) => channel.invokeMethod('setReplayConfig', { 'width': config.width, 'height': config.height, diff --git a/flutter/test/sentry_native_channel_test.dart b/flutter/test/sentry_native_channel_test.dart index c26862b6d..fa84a32ee 100644 --- a/flutter/test/sentry_native_channel_test.dart +++ b/flutter/test/sentry_native_channel_test.dart @@ -335,12 +335,16 @@ void main() { ReplayConfig(width: 1.1, height: 2.2, frameRate: 3, bitRate: 4); await sut.setReplayConfig(config); - verify(channel.invokeMethod('setReplayConfig', { - 'width': config.width, - 'height': config.height, - 'frameRate': config.frameRate, - 'bitRate': config.bitRate, - })); + if (mockPlatform.isAndroid) { + verify(channel.invokeMethod('setReplayConfig', { + 'width': config.width, + 'height': config.height, + 'frameRate': config.frameRate, + 'bitRate': config.bitRate, + })); + } else { + verifyNever(channel.invokeMethod('setReplayConfig', any)); + } }); test('captureReplay', () async {