Skip to content

iOS: keep call audio after audio session changes and CallKit hold - #102

Merged
Magmusacy merged 5 commits into
masterfrom
fce-3912
Oct 9, 2026
Merged

Magmusacy merged 5 commits into
masterfrom
fce-3912

Conversation

@Magmusacy

@Magmusacy Magmusacy commented Oct 7, 2026 •

Copy link
Copy Markdown

Fixes iOS call audio going silent mid-call after another library deactivates the audio session or a CallKit call is held.

Problem

  1. Other code (e.g. expo-audio after a sound) or CallKit (hold) deactivates the audio session.
  2. iOS stops WebRTC's audio unit, but WebRTC still has it marked as started.
  3. Nothing restarts it: microphone and playout stay silent; only rejoining helps.

Changes

  1. Bumps FishjamWebRTC to 124.0.2.4 on iOS and Android (iOS: recover call audio after external audio session changes webrtc#3): WebRTC restarts its audio unit when something else stops it. The fix is iOS-only; Android is bumped to keep both platforms on the same version.
  2. CallKitManager switches WebRTC audio off (useManualAudio + isAudioEnabled = NO) on hold, before fulfilling the hold action. CallKit deactivates the session only after that, so nothing restarts the unit while the call is held.
  3. Audio is switched back on in provider:didActivateAudioSession: and when the call is cleaned up.

Apps should not stop or start the microphone on the held event: startMicrophone() creates a track that is never sent, so the other side hears silence after the call is resumed.

Testing

iPhone 16 + fishjam-chat + browser peer, with a local 124.0.2.4 build:

  • expo-audio sound / setIsAudioActiveAsync(false) (foreground and background): audio back after ~0.4 s.
  • CallKit hold → unhold, incl. app foregrounded, session deactivated, mic toggled or peer rejoining during the hold: silent while held, back after ~1 s, peer hears the mic.
  • Call ended while held, then a new call: audio works.
  • Regular call flows: no regressions.

@linear

linear Bot commented Oct 7, 2026

Copy link
Copy Markdown

FCE-3912

@Magmusacy Magmusacy changed the title iOS: keep call audio after audio session changes iOS: keep call audio after audio session changes and CallKit hold Oct 7, 2026
@Magmusacy
Magmusacy requested a balanced review from Copilot October 7, 2026 15:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

Native CallKit audio-session sequencing remains high-risk because the real cross-app “Hold & Accept” flow is untested.

0 open findings

What changed in this PR

Updates iOS WebRTC audio handling to recover after audio-session changes and CallKit holds.

Changes:

  • Disables WebRTC audio while a call is held and restores it upon activation or cleanup.
  • Upgrades FishjamWebRTC to 124.0.2.4.
File Description
ios/​RCTWebRTC/​CallKitManager.m Coordinates WebRTC audio state with CallKit hold and activation events.
FishjamReactNativeWebrtc.podspec Bumps the native WebRTC dependency.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@Magmusacy
Magmusacy marked this pull request as ready for review October 7, 2026 18:21
Comment thread ios/RCTWebRTC/CallKitManager.m Outdated
Comment thread ios/RCTWebRTC/CallKitManager.m
@Magmusacy
Magmusacy merged commit e5deed6 into master Oct 9, 2026
8 checks passed
@Magmusacy
Magmusacy deleted the fce-3912 branch October 9, 2026 12: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.

3 participants