Skip to content

Commit

Permalink
Merge pull request #76 from sendbird/v4.0.8
Browse files Browse the repository at this point in the history
Add 4.0.8.
  • Loading branch information
sf-tyler-jeong authored Aug 22, 2023
2 parents f022b55 + 99f1dcd commit 0b3d77d
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 10 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## v4.0.8 (Aug 22, 2023)

### Features
- Replaced `Map<String, String> templateVariables` with `Map<String, dynamic> templateVariables` in `NotificationData`.
- Added `tags` in `NotificationData`.

### Improvements
- Improved stability.

## v4.0.7 (Aug 18, 2023)

### Features
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ Before installing Sendbird Chat SDK, you need to create a Sendbird application o

```yaml
dependencies:
sendbird_chat_sdk: ^4.0.7
sendbird_chat_sdk: ^4.0.8
```
- Run `flutter pub get` command in your project directory.
Expand Down
2 changes: 1 addition & 1 deletion lib/src/internal/main/chat/chat.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ part 'chat_notifications.dart';
part 'chat_push.dart';
part 'chat_user.dart';

const sdkVersion = '4.0.7';
const sdkVersion = '4.0.8';

// Internal implementation for main class. Do not directly access this class.
class Chat with WidgetsBindingObserver {
Expand Down
11 changes: 7 additions & 4 deletions lib/src/public/core/message/base_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -575,14 +575,17 @@ abstract class BaseMessage {
if (subData != null) {
Map<String, dynamic>? subDataMap = jsonDecode(subData);
if (subDataMap != null) {
final Map<String, String>? templateVariablesMap =
(subDataMap['template_variables'] as Map<String, dynamic>?)
?.map((key, value) => MapEntry(key, value as String));
final List<String>? tags = (subDataMap['tags'] as List<dynamic>?)
?.map((value) => value as String)
.toList();

message.notificationData = NotificationData(
templateKey: subDataMap['template_key'] as String? ?? '',
templateVariables: templateVariablesMap ?? {},
templateVariables:
subDataMap['template_variables'] as Map<String, dynamic>? ??
{},
label: subDataMap['label'] as String?,
tags: tags,
);
}
}
Expand Down
11 changes: 8 additions & 3 deletions lib/src/public/main/model/message/notification_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,21 @@ class NotificationData {
final String templateKey;

/// templateVariables
/// @since 4.0.7
final Map<String, String> templateVariables;
/// @since 4.0.8
final Map<String, dynamic> templateVariables;

/// label
/// @since 4.0.7
String? label;

/// tags
/// @since 4.0.8
List<String> tags;

NotificationData({
required this.templateKey,
required this.templateVariables,
this.label,
});
List<String>? tags,
}) : tags = tags ?? [];
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: sendbird_chat_sdk
description: With Sendbird Chat for Flutter, you can easily build an in-app chat with all the essential messaging features.
version: 4.0.7
version: 4.0.8
homepage: https://sendbird.com
repository: https://github.com/sendbird/sendbird-chat-sdk-flutter
documentation: https://sendbird.com/docs/chat/sdk/v4/flutter/getting-started/send-first-message
Expand Down

0 comments on commit 0b3d77d

Please sign in to comment.