From 0d872a09b7c7d7eb56916beb7911a87ae4968eec Mon Sep 17 00:00:00 2001 From: Sergei Date: Tue, 20 Jan 2026 09:41:14 -0800 Subject: [PATCH] Fix iOS audio session "status -50" error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove allowBluetoothA2DP from audioCategoryOptions. This option is incompatible with playAndRecord category on some iOS versions. The allowBluetooth (HFP profile) is sufficient for voice calls. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- utils/audioSession.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/utils/audioSession.ts b/utils/audioSession.ts index 6da3ba0..48101f2 100644 --- a/utils/audioSession.ts +++ b/utils/audioSession.ts @@ -54,9 +54,11 @@ export async function configureAudioForVoiceCall(): Promise { console.log('[AudioSession] Step 1: Setting Apple audio config...'); await AudioSession.setAppleAudioConfiguration({ audioCategory: 'playAndRecord', + // Note: removed 'allowBluetoothA2DP' - it's incompatible with playAndRecord + // on some iOS versions and causes "status -50" error. + // 'allowBluetooth' (HFP profile) is sufficient for voice calls. audioCategoryOptions: [ 'allowBluetooth', - 'allowBluetoothA2DP', 'defaultToSpeaker', 'mixWithOthers', ], @@ -155,9 +157,11 @@ export async function reconfigureAudioForPlayback(): Promise { // Just reconfigure the same settings - this "refreshes" the audio routing await AudioSession.setAppleAudioConfiguration({ audioCategory: 'playAndRecord', + // Note: removed 'allowBluetoothA2DP' - it's incompatible with playAndRecord + // on some iOS versions and causes "status -50" error. + // 'allowBluetooth' (HFP profile) is sufficient for voice calls. audioCategoryOptions: [ 'allowBluetooth', - 'allowBluetoothA2DP', 'defaultToSpeaker', 'mixWithOthers', ], @@ -213,11 +217,12 @@ export async function setAudioOutput(useSpeaker: boolean): Promise { }); // Also update the full configuration to ensure it takes effect + // Note: removed 'allowBluetoothA2DP' - causes "status -50" error await AudioSession.setAppleAudioConfiguration({ audioCategory: 'playAndRecord', audioCategoryOptions: useSpeaker - ? ['allowBluetooth', 'allowBluetoothA2DP', 'defaultToSpeaker', 'mixWithOthers'] - : ['allowBluetooth', 'allowBluetoothA2DP', 'mixWithOthers'], + ? ['allowBluetooth', 'defaultToSpeaker', 'mixWithOthers'] + : ['allowBluetooth', 'mixWithOthers'], audioMode: 'voiceChat', }); } else if (Platform.OS === 'android') {