Skip to content

Commit ea41ef1

Browse files
authored
Merge branch 'main' into flutter/android-setup
2 parents 968eba4 + 3e34d62 commit ea41ef1

File tree

213 files changed

+21728
-11471
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

213 files changed

+21728
-11471
lines changed

.github/ISSUE_TEMPLATE/bug-report.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ body:
44
- type: checkboxes
55
attributes:
66
label: Are you certain it's a bug?
7-
description: If you're uncertain, feel free to ping us at our community Discord server instead - https://community.dyte.io
7+
description: If you're uncertain, feel free to ping us at support@dyte.io
88
options:
99
- label: Yes, it looks like a bug
1010
required: true

.github/ISSUE_TEMPLATE/config.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
blank_issues_enabled: false
22
contact_links:
33
- name: Question
4-
url: https://community.dyte.io
5-
about: Please ask and answer questions on our community Discord server.
4+
url: mailto:support@dyte.io
5+
about: Please ask and answer questions on our support email.

babel.config.js

-5
This file was deleted.

docs/android-core/Introduction.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Introduction
3-
sidebar_position: 3
3+
sidebar_position: 4
44
sidebar_class_name: module-seperation
55
---
66

docs/android-core/chat/introduction.mdx

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Introducing chat
2+
title: Introduction
33
description: >-
44
Learn the basics of integrating Dyte's chat functionality into your Android
55
application – a step towards immersive real-time communication.
@@ -29,7 +29,8 @@ class DyteTextMessage(
2929
pluginId: String?,
3030
val message: String,
3131
time: String,
32-
channelId: String? = null,
32+
createdAtMillis: Long,
33+
targetUserIds: List<String>?,
3334
)
3435
```
3536

@@ -43,7 +44,8 @@ class DyteImageMessage(
4344
pluginId: String?,
4445
val link: String,
4546
time: String,
46-
channelId: String? = null,
47+
createdAtMillis: Long,
48+
targetUserIds: List<String>?,
4749
)
4850
```
4951

@@ -57,9 +59,10 @@ class DyteFileMessage(
5759
pluginId: String?,
5860
val name: String,
5961
time: String,
62+
createdAtMillis: Long,
6063
val link: String,
6164
val size: Long,
62-
channelId: String? = null,
65+
targetUserIds: List<String>?,
6366
)
6467
```
6568

docs/android-core/chat/receiving-chat-messages.mdx

+7-1
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,25 @@ subscribe to this events by calling
2020
meeting.addChatEventsListener(object :
2121
DyteChatEventsListener {
2222
override fun onChatUpdates(messages: List<DyteChatMessage>) {
23-
// to load chat messages
23+
// to load chat messages
2424
}
2525

2626
override fun onNewChatMessage(message: DyteChatMessage) {
2727
// when a new chat message is shared in the meeting
2828
}
29+
30+
override fun onMessageRateLimitReset() {
31+
// when the rate limit for sending messages of self is reset
32+
}
2933
})
3034
```
3135

3236
The `onChatUpdates()` method will be called whenever there is a change in the chat messages. The `messages` parameter is a list of `DyteChatMessage` objects that have been sent in the chat.
3337

3438
The `onNewChatMessage()` method will be called whenever a new chat message is shared in the meeting. The `message` parameter is a `DyteChatMessage` object that has been sent in the chat.
3539

40+
The `onMessageRateLimitReset()` method will be called when the rate limit for sending messages of self is reset and you can send messages again. The default rate limit is 180 messages within 60 seconds.
41+
3642
<head>
3743
<title>Android Core Receiving chat</title>
3844
</head>

docs/android-core/chat/sending-a-chat-message.mdx

+38-6
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,51 @@ You can send an image with the help of `meeting.chat.sendImageMessage()` and
2828
sends it to the participants in the meeting.
2929

3030
```kotlin
31-
val filePath = "file_path_of_image"
32-
val fileName = "file_name"
33-
meeting.chat.sendImageMessage(filePath, fileName)
31+
meeting.chat.sendImageMessage(imageUri) { err ->
32+
// Handle error if any
33+
}
3434
```
3535

3636
## Send a file
3737

3838
Sending a file is quite similar to sending an image. The only difference is that when you send an image, a preview will be shown in the meeting chat, which is not the case for sending files. That being said, an image can be sent as a file too using `meeting.chat.sendFileMessage()`.
3939

4040
```kotlin
41-
val filePath = "file_path_of_image"
42-
val fileName = "file_name"
43-
meeting.chat.sendFileMessage(filePath, fileName)
41+
meeting.chat.sendFileMessage(fileUri) { err ->
42+
// Handle error if any
43+
}
44+
```
45+
46+
## Chat Errors
47+
48+
The `sendTextMessage` method returns a `ChatTextError` if the operation fails, `null` if successful. The error can be the following:
49+
50+
- `PermissionDenied`: The user does not have permission to send a message.
51+
- `MessageIsBlank`: The message is empty.
52+
- `CharacterLimitExceeded`: The message exceeds the character limit. Default limit is 2000 characters.
53+
- `RateLimitBreached`: The user has sent too many messages in a short period of time.
54+
55+
Both `sendImageMessage` and `sendFileMessage` methods accept a callback function that will be called with a `ChatFileError` if the operation is not successful, otherwise with `null` if successful.
56+
57+
Possible `ChatFileError`s are:
58+
59+
- `FileFormatNotAllowed`: The file format is not allowed.
60+
- `PermissionDenied`: The user does not have permission to send a file.
61+
- `RateLimitBreached`: The user has breached the rate limit for sending messages.
62+
- `ReadFailed`: The file could not be read.
63+
- `UploadFailed`: The file could not be uploaded.
64+
65+
A `when` block can be used to handle these errors inside the callback, as shown below:
66+
67+
```kotlin
68+
when (err) {
69+
is ChatFileError.FileFormatNotAllowed -> {}
70+
is ChatFileError.PermissionDenied -> {}
71+
is ChatFileError.RateLimitBreached -> {}
72+
is ChatFileError.ReadFailed -> {}
73+
is ChatFileError.UploadFailed -> {}
74+
else -> {}
75+
}
4476
```
4577

4678
<head>

0 commit comments

Comments
 (0)