colossal-manchester-31772
09/09/2025, 6:57 PMtall-airline-16756
09/09/2025, 6:57 PMtall-airline-16756
09/09/2025, 6:58 PMsend method from the useChat React hook in the Android and iOS SDKs is the sendText method. This method allows you to send text messages through LiveKit's data streams on a specific topic, like lk.chat.
For Android, you can use:
val text = "Hello, how are you today?"
val info = try await room.localParticipant.sendText(text, for: "lk.chat")
For iOS (Swift), it works in a similar way:
let text = "Hello, how are you today?"
let info = try await room.localParticipant.sendText(text, for: "lk.chat")
Also, LiveKit offers a streamText method that’s great for sending text incrementally—perfect if you’re dealing with large or dynamically generated content in chunks.
If you have any questions or would like more examples, please don’t hesitate to ask. I’m here to help!
Sources: Docs::Home | livekit-compose-components/src/test/java/io/livekit/android/compose/chat/Ch...