Skip to content

Commit c92d893

Browse files
committed
fix: skip recording operations for macos
1 parent c385b62 commit c92d893

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

lib/src/posthog_flutter_io.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ class PosthogFlutterIO extends PosthogFlutterPlatformInterface {
661661

662662
@override
663663
Future<void> startSessionRecording({bool resumeCurrent = true}) async {
664-
if (!isSupportedPlatform()) {
664+
if (!isSupportedPlatform() || isMacOS()) {
665665
return;
666666
}
667667

@@ -674,7 +674,7 @@ class PosthogFlutterIO extends PosthogFlutterPlatformInterface {
674674

675675
@override
676676
Future<void> stopSessionRecording() async {
677-
if (!isSupportedPlatform()) {
677+
if (!isSupportedPlatform() || isMacOS()) {
678678
return;
679679
}
680680

@@ -687,7 +687,7 @@ class PosthogFlutterIO extends PosthogFlutterPlatformInterface {
687687

688688
@override
689689
Future<bool> isSessionReplayActive() async {
690-
if (!isSupportedPlatform()) {
690+
if (!isSupportedPlatform() || isMacOS()) {
691691
return false;
692692
}
693693

lib/src/util/platform_io_real.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ bool isSupportedPlatform() {
77
}
88
return !(Platform.isLinux || Platform.isWindows);
99
}
10+
11+
bool isMacOS() {
12+
return Platform.isMacOS;
13+
}

lib/src/util/platform_io_stub.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ import 'package:flutter/foundation.dart';
33
bool isSupportedPlatform() {
44
return kIsWeb;
55
}
6+
7+
bool isMacOS() {
8+
return false;
9+
}

0 commit comments

Comments
 (0)