Hey everyone! We’ve integrated LiveKit into our R...
# agents
p
Hey everyone! We’ve integrated LiveKit into our React Native app (around 1M monthly users) to provide voice AI assistance similar to ChatGPT’s voice mode. I’m looking for guidance on the best way to manage LiveKit sessions for a smooth user experience. Here’s the scenario: • When a user closes the voice screen and navigates elsewhere, I’m unsure whether to keep the session running(muting the mic in the background) or end it and create a new one when they return. • Keeping LiveKit active in the background seems to trigger ANR issues on Google Play. • Starting a new session each time causes a 2-3 second delay before the agent’s first response (during the greeting). What’s the recommended or standard approach for session management in this case - balancing performance, responsiveness, and user experience? Any insights or best practices from others who’ve tackled this would be super helpful
l
I can give you my 2 cents as a former Android developer: There are LK docs about keeping the app running in the background, https://github.com/livekit/client-sdk-react-native/blob/main/README.md#background-processing, which rely on foreground service permissions - that is the right way to implement this feature and avoid ANR, but bare in mind that FGS require additional Play Store steps during submission and can potentially confuse your user. In my opinion, if your users see your app similar to a telephone call, where they expect a long running conversation, then a FGS makes sense, otherwise, you should start a new session each time.
p
Thanks