I updated my livekit client flutter sdk version fr...
# ask-ai
w
I updated my livekit client flutter sdk version from 2.3.1 to 2.5.1 and now when i connect with microphone with iOS room.remoteParticipants is always empty. However, if I mute (remove the localAudioTrack) before joining everything works and I can see users inside room.remoteParticipants. Why is that?
t
Thanks for reaching out, Marcus. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'm sorry to hear you're having trouble with
room.remoteParticipants
showing up empty when connecting with the microphone on iOS after updating to Flutter SDK 2.5.1. Let's work through this together and see what might be causing it. Here are a few things that could be at play and some suggestions to try out: • Track Initialization Bug: There was a fix in 2.5.1 related to how track properties initialize. It might help to double-check that your connection logic is updated to handle participant events correctly. • iOS Plugin Conflicts: Sometimes, background service plugins like
flutter_background_service
can interfere with LiveKit's event channels. If you’re using any, try disabling them temporarily to see if that makes a difference. • iOS Permissions: It’s important to make sure your
Info.plist
has the right microphone permissions set, like this:
Copy code
<key>NSMicrophoneUsageDescription</key><string>$(PRODUCT_NAME) uses your microphone</string>
• Event Handling: Make sure you’re listening for participant events and checking
remoteParticipants
after the
RoomConnectedEvent
fires. • Connection Timing: Also, confirm that
room.connectionState
is
ConnectionState.connected
before you try to access
remoteParticipants
. To get a clearer picture and help you better, could you please share a bit more about your setup? • Are you using any background service plugins? • Could you share your connection code and when you check
remoteParticipants
? • Do you see any console errors or warnings during connection? • Does this issue happen if the microphone isn’t enabled? With these details, I’ll be able to guide you more precisely. Looking forward to helping you get this sorted! Sources: [Flutter iOS] SoundWaveformWidget / AudioVisualizerWidget Not Working (Miss... | Flutter quickstart | LiveKit Docs | lib/src/options.dart
w
But why should the iOS user be able to effect how many people there are in room.remoteParticipants? The iOS can control this value by either connecting with or without the microphone. That should not be possible at all. The iOS user should be able to connect with whatever setup they want and the room.remoteParticipant should just return the remoteParticipants no matter what...
t
Thank you for sharing the details about the behavior you're seeing, where connecting with the microphone seems to affect
room.remoteParticipants
. This is likely related to how participant updates are managed within LiveKit's event-driven system. When you enable the microphone, it can trigger track publication events, which might then lead to participant update events. Some recent fixes in Flutter SDK 2.5.1, like track property initialization and improvements specific to iOS WebRTC, could be influencing this behavior. On iOS, there are a few extra things to keep in mind: • Track Publication Events: Turning on the microphone might trigger events that update participant information. • iOS WebRTC Conflicts: The fixes in 2.5.1 addressed some WebRTC pod version conflicts, which could affect how participant states are managed. • Plugin Interference: Sometimes, background service or audio-related plugins (like
flutter_background_service
) can interfere with LiveKit’s event channels. To help narrow down the cause, you might try: • Logging participant counts before and after you enable the microphone to see exactly when changes happen. • Running the same code on Android to check if this is something specific to iOS. • Reviewing any background service or audio-related plugins that could be affecting event handling. I understand this can be frustrating, and I want to assure you that this behavior isn’t what we expect—the participant list should stay consistent no matter the microphone state. If this issue continues, it might be worth diving deeper into the SDK’s event handling on iOS. Please feel free to reach out anytime; we’re here to support you through this! Sources: example/lib/widgets/controls.dart | [Flutter iOS] SoundWaveformWidget / AudioVisualizerWidget Not Working (Miss... | lib/controllers/app_ctrl.dart
w
But again... Why can iOS users decide if participants exists or not inside room.remoteParticipants depending on their OWN connection settings
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!