damp-kite-83575
11/03/2025, 1:23 PMtall-airline-16756
11/03/2025, 1:23 PMtall-airline-16756
11/03/2025, 1:24 PMRNCallKeep.setSettings, here’s a friendly guide on the options you’ll want to configure under the ios section:
• appName: This is where you specify your app's name as it will appear in CallKit.
• includeCallsInRecents: A true or false setting that decides if calls show up in the recent calls list (feel free to set it to false if you don’t want that).
• audioSession: This object holds your audio session settings:
◦ categoryOptions: Combine options like allowAirPlay, allowBluetooth, allowBluetoothA2DP, and defaultToSpeaker to tailor the audio experience.
◦ mode: Setting this to AudioSessionMode.videoChat helps optimize voice and audio calling behavior.
Here’s a simple example to get you started:
const options = {
ios: {
appName: 'YourAppName',
includeCallsInRecents: false,
audioSession: {
categoryOptions:
AudioSessionCategoryOption.allowAirPlay +
AudioSessionCategoryOption.allowBluetooth +
AudioSessionCategoryOption.allowBluetoothA2DP +
AudioSessionCategoryOption.defaultToSpeaker,
mode: AudioSessionMode.videoChat,
},
},
android: {
alertTitle: 'Permissions required',
alertDescription: 'This application needs to access your phone accounts',
cancelButton: 'Cancel',
okButton: 'Ok',
imageName: 'phone_account_icon',
additionalPermissions: [],
},
};
RNCallKeep.setSettings(options);
When working specifically with Expo, here are a few important tips to keep in mind:
• Make sure to use expo-dev-client for your development builds because LiveKit doesn’t play nicely with the Expo Go app.
• Add the LiveKit Expo plugin to your app.json like this:
{
"expo": {
"plugins": [
"@livekit/expo-plugin"
]
}
}
• Don’t forget to call registerGlobals() in your App.js to set up the necessary WebRTC libraries.
• To enable background audio on iOS, add the "Background Modes" capability in Xcode and make sure "Audio, AirPlay, and Picture in Picture" is selected.
If you have any questions or need a hand with anything else, just let me know—I’m here to help!
Sources: Expo quickstart | LiveKit docs | Camera & microphone | LiveKit Docs | README.mddamp-kite-83575
11/03/2025, 1:27 PMtall-airline-16756
11/03/2025, 1:28 PMaudio and voip to the UIBackgroundModes array in your app’s Info.plist file like this:
<key>UIBackgroundModes</key>
<array>
<string>voip</string>
<string>audio</string>
</array>
This little change helps keep your app active during calls and avoids interruptions. If you have any questions or need a hand with this, just let me know—I’m here to help!
Sources: docs/classes/AudioSession.html | Documentation/iOSInstallation.mddamp-kite-83575
11/03/2025, 1:30 PMtall-airline-16756
11/03/2025, 1:31 PMAudioSessionMode.voiceChat for voice calling using LiveKit, here’s a friendly step-by-step guide you can follow:
1. Set the Audio Session Category:
Start by using AVAudioSession.Category.playAndRecord. This setting allows your app to handle both audio input (like your microphone) and output (through speakers or a headset).
2. Configure Audio Session Category Options:
Here are some options to include:
◦ `.mixWithOthers`: This lets background audio keep playing, so nothing gets interrupted.
◦ `.allowBluetooth`: Makes sure Bluetooth headsets and microphones work smoothly.
◦ `.allowBluetoothA2DP`: Supports high-quality audio when using Bluetooth A2DP devices.
◦ `.allowAirPlay`: Lets you stream audio to AirPlay devices effortlessly.
1. Set the Audio Session Mode:
Use AVAudioSession.Mode.voiceChat to optimize the audio for real-time voice communication, which is perfect for calls.
2. Apply the Configuration via WebRTC:
Here’s a snippet you can use in your app to set this up:
let config = RTCAudioSessionConfiguration()
config.category = AVAudioSession.Category.playAndRecord.rawValue
config.categoryOptions = [
.mixWithOthers,
.allowBluetooth,
.allowBluetoothA2DP,
.allowAirPlay
]
config.mode = AVAudioSession.Mode.voiceChat.rawValue
RTCAudioSessionConfiguration.setWebRTC(config)
Just a couple more helpful notes:
• If you’re working with React Native, try using configureAudio with { ios: { defaultOutput: 'earpiece' } } — this will trigger the voiceChat mode for you.
• Don’t forget to enable the background modes audio and voip in your app’s Info.plist file to keep calls running smoothly even when your app is in the background:
<key>UIBackgroundModes</key>
<array>
<string>voip</string>
<string>audio</string>
</array>
This setup helps ensure your audio routes correctly, supports Bluetooth devices, and handles background calls seamlessly. If you have any questions or need a hand with anything else, just let me know — I’m here to help!
Sources: Sources/LiveKit/Types/AudioSessionConfiguration.swift | shared_swift/LiveKitPlugin.swift | ios/LiveKitReactNativeModule.swiftdamp-kite-83575
11/03/2025, 1:34 PMtall-airline-16756
11/03/2025, 1:35 PMAudioSessionMode.voiceChat in RNCallKeep and smoothly handle any microphone conflicts you might encounter. Here’s a step-by-step guide for you:
1. RNCallKeep Configuration:
First, set the audio session mode and category options for iOS like this:
const options = {
ios: {
appName: 'YourApp',
audioSession: {
mode: AudioSessionMode.voiceChat, // Use voiceChat mode
categoryOptions: [
AudioSessionCategoryOption.allowBluetooth,
AudioSessionCategoryOption.allowBluetoothA2DP,
AudioSessionCategoryOption.defaultToSpeaker,
AudioSessionCategoryOption.mixWithOthers
].reduce((acc, option) => acc + option, 0)
}
},
android: {
alertTitle: 'Permissions required',
alertDescription: 'This application needs to access your phone accounts',
cancelButton: 'Cancel',
okButton: 'Ok',
imageName: 'phone_account_icon',
foregroundService: {
channelId: 'io.livekit.reactnative',
channelName: 'Foreground Service',
notificationTitle: 'LiveKit React Native Example is running in the background',
},
}
};
RNCallKeep.setSettings(options);
1. LiveKit Audio Configuration:
Next, configure LiveKit’s audio session specifically for voice chat like this:
import AudioSession, { AppleAudioCategory, AppleAudioMode, AppleAudioCategoryOption } from '@livekit/react-native';
const audioConfig = {
ios: {
audioCategory: AppleAudioCategory.playAndRecord,
audioCategoryOptions: [
AppleAudioCategoryOption.allowBluetooth,
AppleAudioCategoryOption.mixWithOthers
],
audioMode: AppleAudioMode.voiceChat,
},
android: { /* Android settings if needed */ }
};
await AudioSession.configureAudio(audioConfig);
await AudioSession.startAudioSession();
1. Handle Microphone Conflicts:
Sometimes, other apps like Instagram might use the microphone, causing iOS to deactivate your app’s audio session. To manage this gracefully, add these event listeners to respond to session activation and deactivation:
RNCallKeep.addEventListener('didActivateAudioSession', () => {
console.log("Audio session activated");
RTCAudioSession.audioSessionDidActivate();
});
RNCallKeep.addEventListener('didDeactivateAudioSession', () => {
console.log("Audio session deactivated");
RTCAudioSession.audioSessionDidDeactivate();
});
A couple of helpful tips:
• Make sure to enable mixWithOthers so your app’s audio can coexist with other sounds in the background, even though microphone access stays exclusive.
• For Android, LiveKit takes care of audio focus automatically. You can also use manageAudioFocus: true if you want to handle interruptions more explicitly.
If you have any questions or want me to clarify anything, just let me know—I’m here to help!
Sources: Docs/audio.md | docs/index.htmldamp-kite-83575
11/03/2025, 1:40 PMtall-airline-16756
11/03/2025, 1:42 PM'audioCategory' type error and keep your app running smoothly in the background when switching to apps like Instagram. Here’s a step-by-step guide to help you through this:
1. Fix the 'audioCategory' Type Error:
Make sure you’re using the right types and valid values for AppleAudioConfiguration in LiveKit React Native. Here’s how you can do it:
import {
AudioSession,
AppleAudioConfiguration,
AppleAudioCategory
} from '@livekit/react-native';
const audioConfig: AppleAudioConfiguration = {
audioCategory: 'playAndRecord', // Valid AppleAudioCategory value
audioCategoryOptions: ['defaultToSpeaker', 'allowBluetooth'],
audioMode: 'voiceChat'
};
await AudioSession.setAppleAudioConfiguration(audioConfig);
1. Prevent App Suspension in the Background:
To keep your app connected while running in the background, using CallKit is a great approach. Here’s what to do:
• Install react-native-callkeep:
npm install react-native-callkeep
• Configure CallKit:
import RNCallKeep, {
AudioSessionCategoryOption,
AudioSessionMode
} from 'react-native-callkeep';
import { RTCAudioSession } from '@livekit/react-native-webrtc';
const options = {
ios: {
appName: 'YourApp',
includeCallsInRecents: false,
audioSession: {
categoryOptions:
AudioSessionCategoryOption.allowAirPlay +
AudioSessionCategoryOption.allowBluetooth +
AudioSessionCategoryOption.allowBluetoothA2DP +
AudioSessionCategoryOption.defaultToSpeaker,
mode: AudioSessionMode.voiceChat,
},
},
android: {
alertTitle: 'Permissions required',
alertDescription: 'This application needs to access your phone accounts',
cancelButton: 'Cancel',
okButton: 'Ok',
imageName: 'phone_account_icon',
foregroundService: {
channelId: 'io.livekit.reactnative',
channelName: 'Foreground Service',
notificationTitle: 'LiveKit React Native Example is running in the background',
},
},
};
RNCallKeep.setSettings(options);
• Handle Audio Session Events:
RNCallKeep.addEventListener('didActivateAudioSession', () => {
RTCAudioSession.audioSessionDidActivate();
});
RNCallKeep.addEventListener('didDeactivateAudioSession', () => {
RTCAudioSession.audioSessionDidDeactivate();
});
• Enable Background Modes:
Don’t forget to add these keys to your Info.plist to support background audio and VoIP:
<key>UIBackgroundModes</key>
<array>
<string>audio</string>
<string>voip</string>
</array>
• Start and Stop Call Service:
let uuid = '1932b99c-4fe1-4bf4-897f-763bc4dc21c2';
export async function startCallService() {
let handle = '1234567';
let contactIdentifier = 'Caller Contact';
RNCallKeep.startCall(uuid, handle, contactIdentifier, 'number', true);
RNCallKeep.reportConnectingOutgoingCallWithUUID(uuid);
setTimeout(() => {
RNCallKeep.reportConnectedOutgoingCallWithUUID(uuid);
}, 100);
}
export async function stopCallService() {
RNCallKeep.endCall(uuid);
}
By following these steps, your app should stay active during calls and avoid suspension when users switch to other apps. If you have any questions or need a hand with any part of this, please don’t hesitate to reach out—I’m here to help!
Sources: docs/index.htmldamp-kite-83575
11/03/2025, 1:58 PMtall-airline-16756
11/03/2025, 1:59 PMcom.apple.developer.pushkit.unrestricted-voip entitlement in your app’s entitlements file. This step is key to allowing your app to receive VoIP push notifications and handle incoming calls while running in the background.
These settings will help your app stay active in the background for smooth VoIP functionality. If you have any questions or need a hand with anything else, just let me know—I’m here to help!
Sources: Tests/LKTestHost/LKTestHost/Info.plist | callkit/README.md | README.mddamp-kite-83575
11/03/2025, 2:00 PMtall-airline-16756
11/03/2025, 2:00 PMcom.apple.developer.pushkit.unrestricted-voip entitlement. Here’s a simple way to do it:
1. Enable Background Modes in Xcode:
Head over to your app target in Xcode, click on the "Signing & Capabilities" tab, add the "Background Modes" capability, and make sure to check both:
◦ Audio, AirPlay, and Picture in Picture
◦ Voice over IP (VoIP)
1. Configure RNCallKeep and Audio Session:
Make sure your app is set up correctly to handle audio sessions and CallKit events, just like we discussed before. This setup helps your app keep audio running smoothly in the background without needing PushKit.
If you have any questions or need a hand with this, please don’t hesitate to reach out—I’m here to help!damp-kite-83575
11/03/2025, 2:01 PMtall-airline-16756
11/03/2025, 2:02 PMstartCallService() to let the system know there’s an active call happening:
import { startCallService } from './CallService.ios';
// Call when connecting to room
startCallService();
1. Handle Audio Session Activation:
It’s important to notify WebRTC when CallKit activates or deactivates the audio session. You can do this by listening for these events:
RNCallKeep.addEventListener('didActivateAudioSession', () => {
RTCAudioSession.audioSessionDidActivate();
});
RNCallKeep.addEventListener('didDeactivateAudioSession', () => {
RTCAudioSession.audioSessionDidDeactivate();
});
1. Stop the Call Service:
When you leave the room, remember to call stopCallService() to properly end the simulated call:
import { stopCallService } from './CallService.ios';
stopCallService();
1. (Optional) Enable Background Camera Access (iOS 18+):
If your app needs to access the camera while in the background, you can enable multitasking camera access in your native code like this:
// Objective-C
[WebRTCModuleOptions sharedInstance].enableMultitaskingCameraAccess = YES;
// Swift
let options = WebRTCModuleOptions.sharedInstance()
options.enableMultitaskingCameraAccess = true
Also, don’t forget to declare NSCameraUsageDescription and NSMicrophoneUsageDescription in your Info.plist to keep everything running smoothly. If you have any questions or need a hand with any of these steps, just let me know — I’m here to help!
Sources: README.md | Documentation/iOSInstallation.mddamp-kite-83575
11/03/2025, 2:03 PMtall-airline-16756
11/03/2025, 2:04 PMNSMicrophoneUsageDescription key in your Info.plist file with a clear explanation of why your app needs microphone access. Also, be sure to request this permission at runtime using a library like react-native-permissions.
2. Configure RNCallKeep:
Set up RNCallKeep with the right audio session settings to make everything run smoothly:
const options = {
ios: {
appName: 'YourApp',
audioSession: {
categoryOptions:
AudioSessionCategoryOption.allowBluetooth +
AudioSessionCategoryOption.allowBluetoothA2DP +
AudioSessionCategoryOption.defaultToSpeaker,
mode: AudioSessionMode.videoChat,
},
},
};
RNCallKeep.setSettings(options);
1. Handle Audio Session Events:
It’s important to listen for RNCallKeep events so you can keep LiveKit’s WebRTC audio session in sync:
RNCallKeep.addEventListener('didActivateAudioSession', () => {
RTCAudioSession.audioSessionDidActivate();
});
RNCallKeep.addEventListener('didDeactivateAudioSession', () => {
RTCAudioSession.audioSessionDidDeactivate();
});
1. Start LiveKit Audio Session:
Finally, make sure LiveKit’s audio session is properly configured and started like this:
import { AudioSession } from '@livekit/react-native';
await AudioSession.startAudioSession();
Following these steps should help keep your microphone active during background calls. If you have any questions or need a hand with any part of this, just let me know—I’m here to help!
Sources: README.md | Camera & microphone | LiveKit Docsdamp-kite-83575
11/03/2025, 2:05 PMtall-airline-16756
11/03/2025, 2:06 PMAppDelegate.swift and app.json for LiveKit and RNCallKeep on iOS, here’s a simple guide you can follow:
1. AppDelegate.swift Configuration:
Start by adding the following code to initialize LiveKit. You can also optionally enable multitasking camera access for iOS 18 and above if needed:
import livekit_react_native
import livekit_react_native_webrtc
@main
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
) -> Bool {
// Required: Initialize LiveKit
LivekitReactNative.setup()
// Optional: Enable multitasking camera access (iOS 18+, requires voip background mode)
// let options = WebRTCModuleOptions.sharedInstance()
// options.enableMultitaskingCameraAccess = true
return true
}
}
1. app.json Configuration:
If you’re working with Expo, just add the LiveKit plugin to the plugins array in your app.json like this:
{
"expo": {
"plugins": [
[
"../app.plugin.js",
{
"android": {
"audioType": "media"
}
}
],
"@config-plugins/react-native-webrtc"
]
}
}
If your app isn’t using Expo, there’s no need to add anything specific to app.json for LiveKit or RNCallKeep. Please feel free to reach out if you have any questions or need a hand with anything else—I’m here to help!
Sources: docs/index.html | Documentation/iOSInstallation.md | example/app.json | Camera & microphone | LiveKit Docs