LiveKit React Native Client SDK - v3.1.0
    Preparing search index...

    Function setupIOSAudioManagement

    • Sets up automatic iOS audio session management based on audio engine state.

      Call this once at app startup (e.g. in index.js). registerGlobals() invokes it for you by default unless autoConfigureAudioSession: false is passed.

      By default the audio session is configured and activated natively as the audio engine changes state, with no JavaScript involvement per transition.

      For custom categories/modes, pass a static IOSAudioSessionPolicy. That policy is pushed to native once and applied on the audio worker thread.

      Calling this again replaces the previous setup, including switching between the default and custom paths. Switch while disconnected; a switch during an active call is unsupported. In particular, switching away from a custom callback setup mid-call abandons the audio session activation that the custom handlers took, so the session may stay active after the call ends.

      Parameters

      • OptionalpreferSpeakerOutput: boolean

        Whether to prefer speaker output. Defaults to true.

      Returns () => void

      A cleanup function that removes the installed handlers or native configuration. A cleanup function from a superseded setup is a no-op.

    • Sets up automatic iOS audio session management with a static native policy.

      Parameters

      • preferSpeakerOutput: boolean

        Unused when a full policy is provided; kept for call-site consistency with the default overload.

      • policy: IOSAudioSessionPolicy

        Static recording/playout configuration applied natively.

      Returns () => void

      setupIOSAudioManagement for the default native path and usage notes.

    • Parameters

      Returns () => void

      The onConfigureNativeAudio callback is unsafe. It runs inside the audio engine's lifecycle callbacks while native code waits for the result (bounded at a few seconds). The callback must return quickly and must not call APIs that enter the WebRTC engine or a peer connection (for example addTransceiver, getUserMedia, or device enumeration): those can block on the same engine operation the callback is holding up. Prefer the default native path, or pass an IOSAudioSessionPolicy.