diff --git a/apps/common-app/src/examples/Record/Record.tsx b/apps/common-app/src/examples/Record/Record.tsx index 6b0f60b63..51844f45d 100644 --- a/apps/common-app/src/examples/Record/Record.tsx +++ b/apps/common-app/src/examples/Record/Record.tsx @@ -19,7 +19,7 @@ const Record: FC = () => { AudioManager.setAudioSessionOptions({ iosCategory: 'playAndRecord', iosMode: 'spokenAudio', - iosOptions: ['allowBluetooth', 'defaultToSpeaker'], + iosOptions: ['allowBluetoothHFP', 'defaultToSpeaker'], }); recorderRef.current = new AudioRecorder({ diff --git a/packages/audiodocs/docs/system/audio-manager.mdx b/packages/audiodocs/docs/system/audio-manager.mdx index 9c2d512d5..b90ec7858 100644 --- a/packages/audiodocs/docs/system/audio-manager.mdx +++ b/packages/audiodocs/docs/system/audio-manager.mdx @@ -20,7 +20,7 @@ function App() { AudioManager.setAudioSessionOptions({ iosCategory: 'playback', iosMode: 'default', - iosOptions: ['allowBluetooth', 'allowAirPlay'], + iosOptions: ['allowBluetoothHFP', 'allowAirPlay'], }) // set info for track to be visible while device is locked @@ -230,7 +230,8 @@ type IOSOption = | 'duckOthers' | 'allowAirPlay' | 'mixWithOthers' - | 'allowBluetooth' + | 'allowBluetoothHFP' + | 'bluetoothHighQualityRecording' | 'defaultToSpeaker' | 'allowBluetoothA2DP' | 'overrideMutedMicrophoneInterruption' diff --git a/packages/react-native-audio-api/ios/audioapi/ios/system/AudioSessionManager.mm b/packages/react-native-audio-api/ios/audioapi/ios/system/AudioSessionManager.mm index 072e56f2a..b67acc5aa 100644 --- a/packages/react-native-audio-api/ios/audioapi/ios/system/AudioSessionManager.mm +++ b/packages/react-native-audio-api/ios/audioapi/ios/system/AudioSessionManager.mm @@ -87,8 +87,12 @@ - (void)setAudioSessionOptions:(NSString *)category sessionOptions |= AVAudioSessionCategoryOptionMixWithOthers; } - if ([option isEqualToString:@"allowBluetooth"]) { - sessionOptions |= AVAudioSessionCategoryOptionAllowBluetooth; + if ([option isEqualToString:@"allowBluetoothHFP"]) { + sessionOptions |= AVAudioSessionCategoryOptionAllowBluetoothHFP; + } + + if (@available(iOS 26.0, *) && [option isEqualToString:@"bluetoothHighQualityRecording"]) { + sessionOptions |= AVAudioSessionCategoryOptionBluetoothHighQualityRecording; } if ([option isEqualToString:@"defaultToSpeaker"]) { diff --git a/packages/react-native-audio-api/src/system/types.ts b/packages/react-native-audio-api/src/system/types.ts index 8625eab25..66e891fdf 100644 --- a/packages/react-native-audio-api/src/system/types.ts +++ b/packages/react-native-audio-api/src/system/types.ts @@ -21,7 +21,8 @@ export type IOSOption = | 'duckOthers' | 'allowAirPlay' | 'mixWithOthers' - | 'allowBluetooth' + | 'allowBluetoothHFP' + | 'bluetoothHighQualityRecording' | 'defaultToSpeaker' | 'allowBluetoothA2DP' | 'overrideMutedMicrophoneInterruption'