version bump
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
## 0.2.7
|
||||||
|
|
||||||
|
- Update llc dependency
|
||||||
|
- Fixed a bug that made the SDK crash if it went to background while not connected
|
||||||
|
|
||||||
## 0.2.6+1
|
## 0.2.6+1
|
||||||
|
|
||||||
- Update llc dependency
|
- Update llc dependency
|
||||||
|
|||||||
+49
-46
@@ -176,55 +176,58 @@ class StreamChatState extends State<StreamChat> with WidgetsBindingObserver {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
void didChangeAppLifecycleState(AppLifecycleState state) {
|
void didChangeAppLifecycleState(AppLifecycleState state) {
|
||||||
if (state == AppLifecycleState.paused) {
|
if (client.state?.user != null) {
|
||||||
if (client.showLocalNotification != null) {
|
if (state == AppLifecycleState.paused) {
|
||||||
_newMessageSubscription = client
|
if (client.showLocalNotification != null) {
|
||||||
.on(EventType.messageNew)
|
_newMessageSubscription = client
|
||||||
.where((e) => e.user?.id != user.id)
|
.on(EventType.messageNew)
|
||||||
.where((e) => e.message.silent != true)
|
.where((e) => e.user?.id != user.id)
|
||||||
.listen((event) async {
|
.where((e) => e.message.silent != true)
|
||||||
var channel = client.state.channels[event.cid];
|
.listen((event) async {
|
||||||
|
var channel = client.state.channels[event.cid];
|
||||||
|
|
||||||
if (channel == null) {
|
if (channel == null) {
|
||||||
channel = client.channel(
|
channel = client.channel(
|
||||||
event.type,
|
event.type,
|
||||||
id: event.cid.split(':')[1],
|
id: event.cid.split(':')[1],
|
||||||
|
);
|
||||||
|
await channel.query();
|
||||||
|
}
|
||||||
|
|
||||||
|
client.showLocalNotification(
|
||||||
|
event.message,
|
||||||
|
ChannelModel(
|
||||||
|
id: channel.id,
|
||||||
|
createdAt: channel.createdAt,
|
||||||
|
extraData: channel.extraData,
|
||||||
|
type: channel.type,
|
||||||
|
memberCount: channel.memberCount,
|
||||||
|
frozen: channel.frozen,
|
||||||
|
cid: channel.cid,
|
||||||
|
deletedAt: channel.deletedAt,
|
||||||
|
config: channel.config,
|
||||||
|
createdBy: channel.createdBy,
|
||||||
|
updatedAt: channel.updatedAt,
|
||||||
|
lastMessageAt: channel.lastMessageAt,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
await channel.query();
|
});
|
||||||
}
|
_disconnectTimer = Timer(client.backgroundKeepAlive, () {
|
||||||
|
client.disconnect();
|
||||||
client.showLocalNotification(
|
});
|
||||||
event.message,
|
} else {
|
||||||
ChannelModel(
|
|
||||||
id: channel.id,
|
|
||||||
createdAt: channel.createdAt,
|
|
||||||
extraData: channel.extraData,
|
|
||||||
type: channel.type,
|
|
||||||
memberCount: channel.memberCount,
|
|
||||||
frozen: channel.frozen,
|
|
||||||
cid: channel.cid,
|
|
||||||
deletedAt: channel.deletedAt,
|
|
||||||
config: channel.config,
|
|
||||||
createdBy: channel.createdBy,
|
|
||||||
updatedAt: channel.updatedAt,
|
|
||||||
lastMessageAt: channel.lastMessageAt,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
_disconnectTimer = Timer(client.backgroundKeepAlive, () {
|
|
||||||
client.disconnect();
|
client.disconnect();
|
||||||
});
|
}
|
||||||
} else {
|
} else if (state == AppLifecycleState.resumed) {
|
||||||
client.disconnect();
|
_newMessageSubscription?.cancel();
|
||||||
}
|
if (_disconnectTimer?.isActive == true) {
|
||||||
} else if (state == AppLifecycleState.resumed) {
|
_disconnectTimer.cancel();
|
||||||
_newMessageSubscription?.cancel();
|
} else {
|
||||||
if (_disconnectTimer?.isActive == true) {
|
if (client.wsConnectionStatus.value ==
|
||||||
_disconnectTimer.cancel();
|
ConnectionStatus.disconnected) {
|
||||||
} else {
|
NotificationService.handleIosMessageQueue(client);
|
||||||
if (client.wsConnectionStatus.value == ConnectionStatus.disconnected) {
|
client.connect();
|
||||||
NotificationService.handleIosMessageQueue(client);
|
}
|
||||||
client.connect();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -1,7 +1,7 @@
|
|||||||
name: stream_chat_flutter
|
name: stream_chat_flutter
|
||||||
homepage: https://github.com/GetStream/stream-chat-flutter
|
homepage: https://github.com/GetStream/stream-chat-flutter
|
||||||
description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter.
|
description: Stream Chat official Flutter SDK. Build your own chat experience using Dart and Flutter.
|
||||||
version: 0.2.6+1
|
version: 0.2.7
|
||||||
repository: https://github.com/GetStream/stream-chat-flutter
|
repository: https://github.com/GetStream/stream-chat-flutter
|
||||||
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
|
issue_tracker: https://github.com/GetStream/stream-chat-flutter/issues
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ dependencies:
|
|||||||
file_picker: ^1.12.0
|
file_picker: ^1.12.0
|
||||||
image_picker: ^0.6.7+2
|
image_picker: ^0.6.7+2
|
||||||
flutter_keyboard_visibility: ^3.2.1
|
flutter_keyboard_visibility: ^3.2.1
|
||||||
stream_chat: ^0.2.3+2
|
stream_chat: ^0.2.4
|
||||||
mime: ^0.9.6+3
|
mime: ^0.9.6+3
|
||||||
visibility_detector: ^0.1.5
|
visibility_detector: ^0.1.5
|
||||||
http_parser: ^3.1.4
|
http_parser: ^3.1.4
|
||||||
|
|||||||
Reference in New Issue
Block a user