Skip to content

Commit d4c03d2

Browse files
Merge pull request #17 from sendbird/release/4.14.0
4.14.0
2 parents 5da6d07 + b7dbfd9 commit d4c03d2

File tree

2 files changed

+118
-2
lines changed

2 files changed

+118
-2
lines changed

CHANGELOG.md

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,121 @@
11
# Changelog
22

3+
## v4.14.0 (Dec 20, 2023)
4+
### Features
5+
- Three new features related to Generative AI have been added: Form type, Suggested replies and Feedback.
6+
- Form type: A form type message is a message that contains a form. A form is a set of questions that a user can answer to collect data from users.
7+
1. How to determine if a message is a form type message:
8+
```kotlin
9+
val BaseMessage.isFormTypeMessage: Boolean
10+
get() = this.forms.isNotEmpty()
11+
```
12+
2. How to save the answer in the SDK when the user enters input:
13+
```kotlin
14+
editText.addTextChangedListener(
15+
object : TextWatcher {
16+
...
17+
override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) {
18+
formField.temporaryAnswer = Answer(formField.key, s.toString())
19+
}
20+
}
21+
)
22+
```
23+
3. Submits a form
24+
```kotlin
25+
// submits form
26+
message.submitForm(form) { e ->
27+
if (e != null) {
28+
// handle error
29+
}
30+
}
31+
32+
// The submitted form is updated through a message update event.
33+
SendbirdChat.addChannelHandler(
34+
"IDENTIFIER",
35+
object : GroupChannelHandler() {
36+
...
37+
override fun onMessageUpdated(channel: BaseChannel, message: BaseMessage) {
38+
message.forms.find { it.formKey == "TARGET_FORM_KEY" }?.isSubmitted // should be true
39+
// update message UI to submitted form
40+
}
41+
}
42+
)
43+
```
44+
- Suggested replies: Suggested reply is a set of items that a user can click quickly to send a message. Suggested replies is contained in a last message.
45+
```kotlin
46+
SendbirdChat.addChannelHandler(
47+
"IDENTIFIER",
48+
object : GroupChannelHandler() {
49+
...
50+
override fun onChannelChanged(channel: BaseChannel) {
51+
if (channel is GroupChannel) {
52+
val suggestedReplies = channel.lastMessage?.suggestedReplies
53+
if (!suggestedReplies.isNullOrEmpty()) {
54+
// draw suggested replies for the channel's last message
55+
}
56+
}
57+
}
58+
}
59+
)
60+
```
61+
- Feedback: Feedback is a feature that allows users to provide their satisfaction or dissatisfaction with the bot's responses.
62+
1. How to draw feedback UI
63+
```kotlin
64+
val feedback = message.myFeedback
65+
when (message.myFeedbackStatus) {
66+
FeedbackStatus.NOT_APPLICABLE -> {
67+
// this message is not applicable for feedback
68+
// Make thumbs-up/down UI invisible or disable here
69+
// `feedback` should be null
70+
}
71+
72+
FeedbackStatus.NO_FEEDBACK -> {
73+
// The feedback is not submitted yet but user can submit feedback
74+
// Make thumbs-up/down UI visible or enable without being selected
75+
// `feedback` should be null
76+
}
77+
FeedbackStatus.SUBMITTED -> {
78+
// The feedback is submitted
79+
// Make thumbs-up/down UI visible or enable as selected
80+
// `feedback` should not be null
81+
}
82+
}
83+
```
84+
2. How to submit / update / delete feedback
85+
```kotlin
86+
// submit feedback
87+
message.submitFeedback(FeedbackRating.Good) { feedback, e ->
88+
when {
89+
feedback != null -> {
90+
// update feedback UI
91+
}
92+
e != null -> {
93+
// handle error
94+
}
95+
}
96+
}
97+
98+
// update feedback
99+
message.updateFeedback(FeedbackRating.Good, "Very good response") { feedback, e ->
100+
when {
101+
feedback != null -> {
102+
// update feedback UI
103+
}
104+
e != null -> {
105+
// handle error
106+
}
107+
}
108+
}
109+
110+
// delete feedback
111+
message.deleteFeedback { e ->
112+
// handle error
113+
}
114+
```
115+
- Introduced `BaseMessage.extras` to enable developers to include their own data in `BaseMessage` and carry it seamlessly.
116+
- Added `logCustom(String, List<BaseMessage>)` in `FeedChannel`.
117+
### Improvements
118+
- Fix the bug where the internal network status flag is incorrect when an app starts from offline mode.
3119
## v4.13.0 (Oct 25, 2023)
4120
### Features
5121
- Added new read-only attribute `messageReviewInfo` in `UserMessage`

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Then, add the dependency to the project's top-level `build.gradle` file:
9090
```gradle
9191
dependencies {
9292
...
93-
implementation 'com.sendbird.sdk:sendbird-chat:4.13.0'
93+
implementation 'com.sendbird.sdk:sendbird-chat:4.14.0'
9494
...
9595
}
9696
```
@@ -103,7 +103,7 @@ TLS 1.3 is enabled by default in Sendbird SDK for Android. To disable it, please
103103
104104
```gradle
105105
dependencies {
106-
implementation ('com.sendbird.sdk:sendbird-chat:4.13.0') {
106+
implementation ('com.sendbird.sdk:sendbird-chat:4.14.0') {
107107
exclude group: 'org.conscrypt', module: 'conscrypt-android'
108108
}
109109
}

0 commit comments

Comments
 (0)