From 99f1dcd036ca8b48b3763d359f86d74c6763da48 Mon Sep 17 00:00:00 2001 From: Tyler Jeong Date: Tue, 22 Aug 2023 14:58:46 +0900 Subject: [PATCH] Add 4.0.8. --- CHANGELOG.md | 9 +++++++++ README.md | 2 +- lib/src/internal/main/chat/chat.dart | 2 +- lib/src/public/core/message/base_message.dart | 11 +++++++---- .../public/main/model/message/notification_data.dart | 11 ++++++++--- pubspec.yaml | 2 +- 6 files changed, 27 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0d84ea8f..62c93061 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +## v4.0.8 (Aug 22, 2023) + +### Features +- Replaced `Map templateVariables` with `Map templateVariables` in `NotificationData`. +- Added `tags` in `NotificationData`. + +### Improvements +- Improved stability. + ## v4.0.7 (Aug 18, 2023) ### Features diff --git a/README.md b/README.md index 6fba0e84..b4931ad2 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/lib/src/internal/main/chat/chat.dart b/lib/src/internal/main/chat/chat.dart index 67a8fba4..ddcb892d 100644 --- a/lib/src/internal/main/chat/chat.dart +++ b/lib/src/internal/main/chat/chat.dart @@ -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 { diff --git a/lib/src/public/core/message/base_message.dart b/lib/src/public/core/message/base_message.dart index 87e9c9d2..b5081fa9 100644 --- a/lib/src/public/core/message/base_message.dart +++ b/lib/src/public/core/message/base_message.dart @@ -575,14 +575,17 @@ abstract class BaseMessage { if (subData != null) { Map? subDataMap = jsonDecode(subData); if (subDataMap != null) { - final Map? templateVariablesMap = - (subDataMap['template_variables'] as Map?) - ?.map((key, value) => MapEntry(key, value as String)); + final List? tags = (subDataMap['tags'] as List?) + ?.map((value) => value as String) + .toList(); message.notificationData = NotificationData( templateKey: subDataMap['template_key'] as String? ?? '', - templateVariables: templateVariablesMap ?? {}, + templateVariables: + subDataMap['template_variables'] as Map? ?? + {}, label: subDataMap['label'] as String?, + tags: tags, ); } } diff --git a/lib/src/public/main/model/message/notification_data.dart b/lib/src/public/main/model/message/notification_data.dart index 103c6560..d50438cb 100644 --- a/lib/src/public/main/model/message/notification_data.dart +++ b/lib/src/public/main/model/message/notification_data.dart @@ -10,16 +10,21 @@ class NotificationData { final String templateKey; /// templateVariables - /// @since 4.0.7 - final Map templateVariables; + /// @since 4.0.8 + final Map templateVariables; /// label /// @since 4.0.7 String? label; + /// tags + /// @since 4.0.8 + List tags; + NotificationData({ required this.templateKey, required this.templateVariables, this.label, - }); + List? tags, + }) : tags = tags ?? []; } diff --git a/pubspec.yaml b/pubspec.yaml index 5c4c8ff9..0e75f433 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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