From 2c61542a5aaa8a1e6c5185352cdcb572dd669d7f Mon Sep 17 00:00:00 2001 From: Sylvain BOILY Date: Sun, 18 Oct 2026 11:09:05 -0400 Subject: [PATCH] fix(ios): reject setAudioRoute when no route has the name 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 ", and leaves the route as it was. --- CHANGELOG.md | 1 + docs/api.md | 1 + ios/RNCallKeep/RNCallKeep.m | 1 + 3 files changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 328366fb..2b3546a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ are not listed here. ### Fixed +- **iOS:** `setAudioRoute()` rejects when no audio route has the given name. Its promise never settled. - **Android:** An outgoing call's connection stays in `STATE_DIALING`, and an incoming call's in `STATE_RINGING`, as Telecom shows them. `setInitialized()`, called after `setDialing()` or `setRinging()`, put the connection back to `STATE_NEW`: `VoiceConnectionService.getConnection(uuid).getState()` returned `STATE_NEW` while the call was dialing or ringing. Samsung devices already skipped it for outgoing calls, where it kept the native UI from showing; every device now does as they did. ## [4.6.0] - 2026-10-18 diff --git a/docs/api.md b/docs/api.md index ba854ea0..0c32081a 100644 --- a/docs/api.md +++ b/docs/api.md @@ -486,6 +486,7 @@ await RNCallKeep.setAudioRoute(uuid, routeName); - AudioRoute.name. On Android, the promise is rejected when no call has this `uuid`, and before Android 8 (API 26), which has no API to change a call's audio route. +On iOS, it is rejected when no audio route has this name. ### supportConnectionService diff --git a/ios/RNCallKeep/RNCallKeep.m b/ios/RNCallKeep/RNCallKeep.m index 8f3a4a2b..c2996d54 100644 --- a/ios/RNCallKeep/RNCallKeep.m +++ b/ios/RNCallKeep/RNCallKeep.m @@ -569,6 +569,7 @@ - (void)setupWithOptions:(NSDictionary *)options return; } } + reject(@"Failure to set audio route", [NSString stringWithFormat:@"No audio route named %@", inputName], nil); } @catch ( NSException *e ){ NSLog(@"[RNCallKeep][setAudioRoute] exception: %@",e);