Skip to content

Commit

Permalink
ios: set audio playback category, fix #210
Browse files Browse the repository at this point in the history
  • Loading branch information
wang-bin committed Jan 30, 2025
1 parent a02b921 commit 01c7456
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion darwin/Classes/FvpPlugin.mm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2023-2024 Wang Bin. All rights reserved.
// Copyright 2023-2025 Wang Bin. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

Expand Down Expand Up @@ -130,6 +130,8 @@ + (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
auto messenger = registrar.messenger;
#else
auto messenger = [registrar messenger];
// Allow audio playback when the Ring/Silent switch is set to silent
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
#endif
FlutterMethodChannel* channel = [FlutterMethodChannel methodChannelWithName:@"fvp" binaryMessenger:messenger];
FvpPlugin* instance = [[FvpPlugin alloc] initWithRegistrar:registrar];
Expand Down

0 comments on commit 01c7456

Please sign in to comment.