Skip to content

Commit 46ee0cd

Browse files
ctrlvntctrlvnt
authored andcommitted
fix: microphone permission for MacOS
1 parent 83c3315 commit 46ee0cd

4 files changed

Lines changed: 11 additions & 1 deletion

File tree

lib/view/widgets/channel_parameters_widget.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import 'dart:io';
2+
13
import 'package:flutter/material.dart';
24
import 'package:permission_handler/permission_handler.dart';
35
import 'package:provider/provider.dart';
@@ -249,7 +251,9 @@ class _ChannelParametersState extends State<ChannelParametersWidget> {
249251
groupValue:
250252
oscilloscopeStateProvider.isInBuiltMICSelected,
251253
onChanged: (bool? value) async {
252-
await Permission.microphone.request();
254+
if(!Platform.isMacOS) {
255+
await Permission.microphone.request();
256+
}
253257
setState(
254258
() {
255259
if (value == null) {

macos/Runner/DebugProfile.entitlements

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@
1212
<true/>
1313
<key>com.apple.security.personal-information.location</key>
1414
<true/>
15+
<key>com.apple.security.device.audio-input</key>
16+
<true/>
1517
</dict>
1618
</plist>

macos/Runner/Info.plist

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,7 @@
3030
<string>NSApplication</string>
3131
<key>NSLocationUsageDescription</key>
3232
<string>This app needs access to location.</string>
33+
<key>NSMicrophoneUsageDescription</key>
34+
<string>This app needs access to microphone for oscilloscope.</string>
3335
</dict>
3436
</plist>

macos/Runner/Release.entitlements

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@
88
<true/>
99
<key>com.apple.security.personal-information.location</key>
1010
<true/>
11+
<key>com.apple.security.device.audio-input</key>
12+
<true/>
1113
</dict>
1214
</plist>

0 commit comments

Comments
 (0)