diff --git a/README.md b/README.md index d213c274..84eddb19 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,8 @@
Ably Chat is a set of purpose-built APIs for a host of chat features enabling you to create 1:1, 1:Many, Many:1 and Many:Many chat rooms for @@ -115,6 +117,9 @@ environments. To use Chat you must also set a [`clientId`](https://ably.com/docs/auth/identified-clients) so that clients are identifiable. If you are prototyping, you can use `java.util.UUID` to generate an ID. +In most cases, `clientId` can be set to `userId`, the user’s application-specific identifier, provided that `userId` +is unique within the context of your application. + ## Connections The Chat SDK uses a single connection to Ably, which is exposed via the `ChatClient#connection` property. You can use this @@ -158,6 +163,8 @@ val room = chat.rooms.get("basketball-stream", RoomOptions(reactions = RoomReact The second argument to `rooms.get` is a `RoomOptions` argument, which tells the Chat SDK what features you would like your room to use and how they should be configured. +You can also use `RoomOptions.default` to enable all room features with the default configuration. + For example, you can set the timeout between keystrokes for typing events as part of the room options. Sensible defaults for each of the features are provided for your convenience: @@ -165,7 +172,16 @@ features are provided for your convenience: - Entry into, and subscription to, presence. The defaults options for each feature may be -viewed [here](https://github.com/ably/ably-chat-js/blob/main/chat-android/src/main/java/com/ably/chat/RoomOptions.kt). +viewed [here](https://github.com/ably/ably-chat-kotlin/blob/main/chat-android/src/main/java/com/ably/chat/RoomOptions.kt). + +Here’s an example demonstrating how to specify a custom typing timeout: + +```kotlin +val room = chat.rooms.get( + "basketball-stream", + RoomOptions(typing = TypingOptions(timeoutMs = 3_000)), +) +``` In order to use the same room but with different options, you must first `release` the room before requesting an instance with the changed options (see below for more information on releasing rooms). @@ -212,7 +228,9 @@ rooms.release("basketball-stream") Once `release` is called, the room will become unusable and you will need to get a new instance using `rooms.get` should you wish to re-start the room. -Note that releasing a room may be optional for many applications. +> [!NOTE] +> Releasing a room may be optional for many applications. If release is not called, the server will automatically tidy up +connections and other resources associated with the room after a period of time. ### Monitoring room status @@ -417,6 +435,9 @@ subscription.unsubscribe() ## Typing indicators +> [!NOTE] +> You should be attached to the room to enable this functionality. + Typing events allow you to inform others that a client is typing and also subscribe to others' typing status. ### Retrieving the set of current typers diff --git a/images/ably-chat-github-header.png b/images/ably-chat-github-header.png new file mode 100644 index 00000000..f61cdd28 Binary files /dev/null and b/images/ably-chat-github-header.png differ