Update SDK to 1.1.5, New add clear c2c message android group message

This commit is contained in:
hrxiang
2021-11-17 11:30:12 +08:00
parent a97048ea9d
commit b5f80cc052
47 changed files with 276 additions and 453 deletions

View File

@@ -31,6 +31,7 @@ class IMManager {
void _addNativeCallback(MethodChannel _channel) {
_channel.setMethodCallHandler((call) {
try {
print('call:$call');
if (call.method == ListenerType.initSDKListener) {
String type = call.arguments['type'];
dynamic data = call.arguments['data'];
@@ -186,6 +187,7 @@ class IMManager {
} else if (call.method == ListenerType.conversationListener) {
String type = call.arguments['type'];
dynamic data = call.arguments['data'];
print('type:$type data:$data');
switch (type) {
case 'onSyncServerStart':
conversationManager.conversationListener.syncServerStart();

View File

@@ -369,6 +369,18 @@ class MessageManager {
.then((value) => _toObj(value));
}
///
Future<dynamic> clearC2CHistoryMessage({required String uid}) {
return _channel.invokeMethod(
'clearC2CHistoryMessage', _buildParam({"userID": uid}));
}
///
Future<dynamic> clearGroupHistoryMessage({required String gid}) {
return _channel.invokeMethod(
'clearGroupHistoryMessage', _buildParam({"groupID": gid}));
}
///
void forceSyncMsg() {
_channel.invokeMethod('forceSyncMsg', _buildParam({}));

View File

@@ -48,11 +48,14 @@ class ConversationInfo {
unreadCount = json['unreadCount'];
// latestMsg = json['latestMsg'];
// if (null != json['latestMsg']) {
if (json['latestMsg'] is String) {
latestMsg = Message.fromJson(jsonDecode(json['latestMsg']));
} else if (json['latestMsg'] is Map) {
latestMsg = Message.fromJson(json['latestMsg']);
}
try {
if (json['latestMsg'] is String) {
latestMsg = Message.fromJson(jsonDecode(json['latestMsg']));
} else if (json['latestMsg'] is Map) {
latestMsg = Message.fromJson(json['latestMsg']);
}
} catch (e) {}
// }
latestMsgSendTime = json['latestMsgSendTime'];