Skip to content

Commit df66442

Browse files
Update per Swift chat room get/release fluency change
See chat-swift commit 2b38ee5.
1 parent d01633a commit df66442

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

src/pages/docs/chat/getting-started/swift.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ struct ContentView: View {
198198

199199
private func setupRoom() async {
200200
do {
201-
let chatRoom = try await chatClient.rooms.get(name: roomName)
201+
let chatRoom = try await chatClient.rooms.get(named: roomName)
202202
try await chatRoom.attach()
203203
self.room = chatRoom
204204

@@ -305,7 +305,7 @@ struct ContentView: View {
305305

306306
private func setupRoom() async {
307307
do {
308-
let chatRoom = try await chatClient.rooms.get(name: roomName)
308+
let chatRoom = try await chatClient.rooms.get(named: roomName)
309309
try await chatRoom.attach()
310310
self.room = chatRoom
311311

@@ -631,7 +631,7 @@ struct ContentView: View {
631631

632632
private func setupRoom() async {
633633
do {
634-
let chatRoom = try await chatClient.rooms.get(name: roomName)
634+
let chatRoom = try await chatClient.rooms.get(named: roomName)
635635
try await chatRoom.attach()
636636
self.room = chatRoom
637637

@@ -802,7 +802,7 @@ struct ContentView: View {
802802

803803
private func setupRoom() async {
804804
do {
805-
let chatRoom = try await chatClient.rooms.get(name: roomName)
805+
let chatRoom = try await chatClient.rooms.get(named: roomName)
806806
try await chatRoom.attach()
807807
self.room = chatRoom
808808

@@ -939,7 +939,7 @@ struct ContentView: View {
939939

940940
private func setupRoom() async {
941941
do {
942-
let chatRoom = try await chatClient.rooms.get(name: roomName)
942+
let chatRoom = try await chatClient.rooms.get(named: roomName)
943943
try await chatRoom.attach()
944944
self.room = chatRoom
945945

@@ -1032,7 +1032,7 @@ struct ContentView: View {
10321032

10331033
private func setupRoom() async {
10341034
do {
1035-
let chatRoom = try await chatClient.rooms.get(name: roomName, options: .init(occupancy: .init(enableEvents: true)))
1035+
let chatRoom = try await chatClient.rooms.get(named: roomName, options: .init(occupancy: .init(enableEvents: true)))
10361036
try await chatRoom.attach()
10371037
self.room = chatRoom
10381038

src/pages/docs/chat/rooms/index.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ The channel name is the same as the room name with an appended suffix of `::$cha
1616
Users send messages to a room and subscribe to the room in order to receive messages.
1717

1818
<If lang="javascript,swift,kotlin">
19-
A `room` is created, or an existing one is retrieved from the `rooms` collection using the <If lang="javascript">[`rooms.get()`](https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Rooms.html#get)</If><If lang="swift">[`rooms.get()`](https://sdk.ably.com/builds/ably/ably-chat-swift/main/AblyChat/documentation/ablychat/rooms/get%28roomid%3Aoptions%3A%29)</If><If lang="kotlin">[`rooms.get()`](https://sdk.ably.com/builds/ably/ably-chat-kotlin/main/dokka/chat-android/com.ably.chat/-rooms/get.html)</If> method:
19+
A `room` is created, or an existing one is retrieved from the `rooms` collection using the <If lang="javascript">[`rooms.get()`](https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Rooms.html#get)</If><If lang="swift">[`rooms.get()`](https://sdk.ably.com/builds/ably/ably-chat-swift/main/AblyChat/documentation/ablychat/rooms/get%28named%3Aoptions%3A%29)</If><If lang="kotlin">[`rooms.get()`](https://sdk.ably.com/builds/ably/ably-chat-kotlin/main/dokka/chat-android/com.ably.chat/-rooms/get.html)</If> method:
2020
</If>
2121

2222
<If lang="react">
@@ -57,7 +57,7 @@ const App = () => {
5757
```
5858

5959
```swift
60-
let room = try await chatClient.rooms.get(roomID: "basketball-stream", options: .init(occupancy: .init(enableEvents: true)))
60+
let room = try await chatClient.rooms.get(named: "basketball-stream", options: .init(occupancy: .init(enableEvents: true)))
6161
```
6262

6363
```kotlin
@@ -97,7 +97,7 @@ let presence = PresenceOptions(enter: false)
9797
let typing = TypingOptions(heartbeatThrottle: 5.0) // seconds
9898
// using defaults for reactions and occupancy
9999
let options = RoomOptions(presence: presence, typing: typing, occupancy: .init())
100-
let room = try await chatClient.rooms.get(roomID: "basketball-stream", options: options)
100+
let room = try await chatClient.rooms.get(named: "basketball-stream", options: options)
101101
```
102102

103103
```kotlin
@@ -132,15 +132,15 @@ Releasing a room allows the underlying resources to be garbage collected or rele
132132
Releasing a room may be optional for many applications. If you have multiple transient rooms, such as in the case of a 1:1 support chat, then it may be more beneficial. Also, proactively disconnecting rather than waiting for the standard two-minute timeout can help reduce costs and improve performance.
133133

134134
<If lang="javascript,swift,kotlin">
135-
Once <If lang="javascript">[`rooms.release()`](https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Rooms.html#release)</If><If lang="swift">[`rooms.release()`](https://sdk.ably.com/builds/ably/ably-chat-swift/main/AblyChat/documentation/ablychat/rooms/release%28roomid%3A%29)</If><If lang="kotlin">[`rooms.release()`](https://sdk.ably.com/builds/ably/ably-chat-kotlin/main/dokka/chat-android/com.ably.chat/-rooms/release.html)</If> has been called, the room will be unusable and a new instance will need to be created using [`rooms.get()`](#create) if you want to reuse it.
135+
Once <If lang="javascript">[`rooms.release()`](https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/interfaces/chat-js.Rooms.html#release)</If><If lang="swift">[`rooms.release()`](https://sdk.ably.com/builds/ably/ably-chat-swift/main/AblyChat/documentation/ablychat/rooms/release%28named%3A%29)</If><If lang="kotlin">[`rooms.release()`](https://sdk.ably.com/builds/ably/ably-chat-kotlin/main/dokka/chat-android/com.ably.chat/-rooms/release.html)</If> has been called, the room will be unusable and a new instance will need to be created using [`rooms.get()`](#create) if you want to reuse it.
136136

137137
<Code>
138138
```javascript
139139
await rooms.release('basketball-stream');
140140
```
141141

142142
```swift
143-
try await rooms.release(roomID: "basketball-stream")
143+
try await rooms.release(named: "basketball-stream")
144144
```
145145

146146
```kotlin

src/pages/docs/chat/rooms/message-reactions.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const room = await ablyChatClient.rooms.get('room1', {
4444

4545
```swift
4646
let room = try await ablyChatClient.rooms.get(
47-
name: "room1",
47+
named: "room1",
4848
options: .init(
4949
messages: .init(defaultMessageReactionType: .unique)
5050
)
@@ -534,7 +534,7 @@ const room = await ablyChatClient.rooms.get('room1', {
534534

535535
```swift
536536
let room = try await ablyChatClient.rooms.get(
537-
name: "room1",
537+
named: "room1",
538538
options: .init(
539539
messages: .init(rawMessageReactions: true)
540540
)

0 commit comments

Comments
 (0)