Skip to content

Commit de6ab9c

Browse files
committed
Archiving in inbox message models
1 parent ed0be29 commit de6ab9c

File tree

5 files changed

+14
-13
lines changed

5 files changed

+14
-13
lines changed

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ android {
5151

5252
dependencies {
5353
implementation 'com.google.code.gson:gson:2.11.0'
54-
api 'com.github.trycourier:courier-android:4.2.4'
54+
api 'com.github.trycourier:courier-android:4.2.5'
5555
api 'com.google.firebase:firebase-messaging-ktx:24.0.0'
5656
}

example/integration_test/client_tests.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,10 @@ void main() {
129129
await delay();
130130
final client = await ClientBuilder.build(userId: userId);
131131
await client.inbox.archive(messageId: messageId);
132+
await delay();
132133
final res = await client.inbox.getArchivedMessages();
133134
final message = res.data?.messages?.nodes?.first;
134-
expect(message?.archived, true);
135+
expect(message?.isArchived, true);
135136
});
136137

137138
test('Get Message By ID', () async {
@@ -143,7 +144,7 @@ void main() {
143144
});
144145

145146
test('Get Unread Message Count', () async {
146-
final newUser = const Uuid().v1();
147+
final newUser = const Uuid().v4();
147148
await sendMessage(newUser);
148149
await delay();
149150
final client = await ClientBuilder.build(userId: newUser);

example/ios/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
PODS:
22
- courier_flutter (0.0.1):
3-
- Courier_iOS (= 4.1.1)
3+
- Courier_iOS (= 4.1.2)
44
- Flutter
5-
- Courier_iOS (4.1.1)
5+
- Courier_iOS (4.1.2)
66
- Firebase/CoreOnly (10.16.0):
77
- FirebaseCore (= 10.16.0)
88
- Firebase/Messaging (10.16.0):
@@ -119,8 +119,8 @@ EXTERNAL SOURCES:
119119
:path: ".symlinks/plugins/url_launcher_ios/ios"
120120

121121
SPEC CHECKSUMS:
122-
courier_flutter: 4c26cbf2d8e25b6981857effde48cae28587ee27
123-
Courier_iOS: b8276143915194dda4b250051332d6161ff47adb
122+
courier_flutter: c842212da7dfa74157e52ab6217aa1e7257e19b0
123+
Courier_iOS: 478e35f6b7d81260afdce333188ef6487528f4a0
124124
Firebase: 25899099b77d255a636e3579c3d9dce10ec150d5
125125
firebase_core: 68027ba03585e3efe1608e35d3ab2777a64eabe9
126126
firebase_messaging: e11ea61b449e6e39741b8a309ddab803ef1eb5cd

ios/courier_flutter.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ A new Flutter plugin project.
1616
s.source = { :path => '.' }
1717
s.source_files = 'Classes/**/*'
1818
s.dependency 'Flutter'
19-
s.dependency 'Courier_iOS', '4.1.1'
19+
s.dependency 'Courier_iOS', '4.1.2'
2020
s.platform = :ios, '13.0'
2121

2222
# Flutter.framework does not contain a i386 slice.

lib/models/inbox_message.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ class InboxMessage {
88
final String? body;
99
final String? preview;
1010
final String? created;
11-
final List<InboxAction>? actions;
12-
final dynamic data;
13-
bool? archived;
11+
String? archived;
1412
String? read;
1513
String? opened;
14+
final List<InboxAction>? actions;
15+
final dynamic data;
1616

1717
InboxMessage({
1818
required this.messageId,
@@ -34,9 +34,9 @@ class InboxMessage {
3434
title: data['title'],
3535
body: data['body'],
3636
preview: data['preview'],
37-
created: data['created'],
3837
actions: actions?.map((action) => InboxAction(content: action['content'], href: action['href'], data: action['data'])).toList(),
3938
data: data['data'],
39+
created: data['created'],
4040
archived: data['archived'],
4141
read: data['read'],
4242
opened: data['opened'],
@@ -49,7 +49,7 @@ class InboxMessage {
4949

5050
bool get isOpened => opened != null;
5151

52-
bool get isArchived => archived ?? false;
52+
bool get isArchived => archived != null;
5353

5454
void setRead() {
5555
read = DateTime.now().toIso8601String();

0 commit comments

Comments
 (0)