Skip to content

fix(ios): reject setAudioRoute when no route has the name - #914

Merged
sboily merged 1 commit into
masterfrom
fix/ios-set-audio-route
Oct 18, 2026
Merged

sboily merged 1 commit into
masterfrom
fix/ios-set-audio-route

Conversation

@sboily

@sboily sboily commented Oct 18, 2026

Copy link
Copy Markdown
Member

Problem

When no audio input had the given port name, setAudioRoute returned without resolving or rejecting: the JavaScript promise never settled.

Fix

Reject with No audio route named <name>. The route is left as it was. docs/api.md documents the rejection.

Tests

On-device harness (the real RNCallKeep.m, real CallKit), during an outgoing call: setAudioRoute with Speaker, the built-in microphone's port name, Speaker, the built-in microphone again, Speaker, then No such route, reading currentRoute.outputs after each step.

Device master this PR
iPhone 15 Pro Max, iOS 27.0.1 No such route: not settled after 3 s rejected, output stays on the speaker
iPhone 7, iOS 15.8.8 No such route: not settled after 3 s rejected, output stays on the speaker

Also checked, and left unchanged: on both devices, setAudioRoute with the built-in microphone after Speaker brings the output back to the receiver, also when the built-in microphone is already the preferred input (setPreferredInput removes the speaker override). On iOS 27, master with setActive:YES restored in getAudioInputs (removed by #863) behaves as master.

When no audio input had the given port name, setAudioRoute ended
without resolving or rejecting, and the JavaScript promise never
settled. It now rejects with "No audio route named <name>", and leaves
the route as it was.
@sboily
sboily force-pushed the fix/ios-set-audio-route branch from 0a42b00 to 2c61542 Compare October 18, 2026 15:33
@sboily
sboily merged commit 33bd8b7 into master Oct 18, 2026
4 checks passed
@sboily
sboily deleted the fix/ios-set-audio-route branch October 18, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant