This message was deleted.
# ask-ai
s
This message was deleted.
t
Thanks for reaching out, Rishabh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
To help you access the room details and room SID from the chat context in the iOS Swift SDK, you can use the
Room
object. It offers handy properties like
sid
,
name
, and
metadata
. Here’s a simple example to guide you:
Copy code
let room = Room()

Task {
    do {
        try await room.connect(url: "your-room-url", token: "your-token")

        // Access room details
        if let roomSid = room.sid {
            print("Room SID: \(roomSid)")
        }
        if let roomName = room.name {
            print("Room Name: \(roomName)")
        }
        if let metadata = room.metadata {
            print("Room Metadata: \(metadata)")
        }
    } catch {
        print("Failed to connect: \(error)")
    }
}
If you’re working with a
ChatContext
object, just make sure it lets you access the underlying
Room
instance. From there, you can easily get the room SID and other details you need. Please feel free to reach out if you’d like me to walk you through any part of this or if you have more questions—I’m here to help! Sources: Shared/Contexts/RoomContext.swift | Multiplatform/Controllers/RoomContext.swift | lib/src/context/room_context.dart | README.md | Room metadata | LiveKit Docs