New add some fuc
This commit is contained in:
		
							parent
							
								
									372e573ea0
								
							
						
					
					
						commit
						73b9eb776f
					
				| @ -2,7 +2,7 @@ | ||||
| 
 | ||||
| 1.Fix some one crash </br> | ||||
| 2.New add signaling function </br> | ||||
| 3.Delete getConversationRecvMessageOpt | ||||
| 3.New add group have read receipt | ||||
| 
 | ||||
| ## 2.0.0+1 | ||||
| 
 | ||||
|  | ||||
| @ -41,5 +41,5 @@ android { | ||||
|     } | ||||
| } | ||||
| dependencies { | ||||
|     implementation 'io.openim:client-sdk:2.0.14@aar' | ||||
|     implementation 'io.openim:client-sdk:2.0.15@aar' | ||||
| } | ||||
| @ -156,6 +156,15 @@ public class MessageManager extends BaseManager { | ||||
|         ); | ||||
|     } | ||||
| 
 | ||||
|     public void markGroupMessageAsRead(MethodCall methodCall, MethodChannel.Result result) { | ||||
|         Open_im_sdk.markGroupMessageAsRead( | ||||
|                 new OnBaseListener(result), | ||||
|                 value(methodCall, "operationID"), | ||||
|                 value(methodCall, "groupID"), | ||||
|                 jsonValue(methodCall, "messageIDList") | ||||
|         ); | ||||
|     } | ||||
| 
 | ||||
|     public void typingStatusUpdate(MethodCall methodCall, MethodChannel.Result result) { | ||||
|         Open_im_sdk.typingStatusUpdate( | ||||
|                 new OnBaseListener(result), | ||||
|  | ||||
| @ -46,4 +46,11 @@ public class SignalingManager extends BaseManager { | ||||
|                 value(methodCall, "operationID"), | ||||
|                 jsonValue(methodCall, "signalingInfo")); | ||||
|     } | ||||
| 
 | ||||
|     public void signalingHungUp(MethodCall methodCall, MethodChannel.Result result) { | ||||
|         Open_im_sdk.signalingHungUp( | ||||
|                 new OnBaseListener(result), | ||||
|                 value(methodCall, "operationID"), | ||||
|                 jsonValue(methodCall, "signalingInfo")); | ||||
|     } | ||||
| } | ||||
|  | ||||
| @ -17,6 +17,7 @@ public class MessageManager: BaseServiceManager { | ||||
|         self["insertGroupMessageToLocalStorage"] = insertGroupMessageToLocalStorage | ||||
|         // self["findMessages"] = findMessages | ||||
|         self["markC2CMessageAsRead"] = markC2CMessageAsRead | ||||
|         self["markGroupMessageAsRead"] = markGroupMessageAsRead | ||||
|         self["typingStatusUpdate"] = typingStatusUpdate | ||||
|         self["createTextMessage"] = createTextMessage | ||||
|         self["createTextAtMessage"] = createTextAtMessage | ||||
| @ -86,7 +87,11 @@ public class MessageManager: BaseServiceManager { | ||||
|     func markC2CMessageAsRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ | ||||
|         Open_im_sdkMarkC2CMessageAsRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[jsonString: "messageIDList"]) | ||||
|     } | ||||
|      | ||||
| 
 | ||||
|     func markGroupMessageAsRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ | ||||
|         Open_im_sdkMarkGroupMessageAsRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[jsonString: "messageIDList"]) | ||||
|     } | ||||
| 
 | ||||
|     func typingStatusUpdate(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ | ||||
|         Open_im_sdkTypingStatusUpdate(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[string: "msgTip"]) | ||||
|     } | ||||
|  | ||||
| @ -11,6 +11,7 @@ public class SignalingManager: BaseServiceManager { | ||||
|         self["signalingAccept"] = signalingAccept | ||||
|         self["signalingReject"] = signalingReject | ||||
|         self["signalingCancel"] = signalingCancel | ||||
|         self["signalingHungUp"] = signalingHungUp | ||||
|     } | ||||
| 
 | ||||
|     func setSignalingListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ | ||||
| @ -37,7 +38,10 @@ public class SignalingManager: BaseServiceManager { | ||||
|     func signalingCancel(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ | ||||
|         Open_im_sdkSignalingCancel(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"]) | ||||
|     } | ||||
|      | ||||
| 
 | ||||
|     func signalingHungUp(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ | ||||
|         Open_im_sdkSignalingHungUp(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "signalingInfo"]) | ||||
|     } | ||||
| } | ||||
| public class SignalingListener: NSObject, Open_im_sdk_callbackOnSignalingListenerProtocol { | ||||
|      | ||||
|  | ||||
										
											Binary file not shown.
										
									
								
							| @ -19,24 +19,40 @@ class MessageType { | ||||
|   static const custom_face = 115; | ||||
| 
 | ||||
|   /// | ||||
|   static const accept_friend = 201; | ||||
|   static const add_friend = 202; | ||||
|   static const refuse_friend_application = 203; | ||||
|   static const set_self_info = 204; | ||||
|   static const revoke_message = 205; | ||||
|   static const c2c_message_as_read = 206; | ||||
|   static const notificationBegin = 1000; | ||||
|   static const friendNotificationBegin = 1200; | ||||
| 
 | ||||
|   static const kick_online = 303; | ||||
|   static const friendApplicationApprovedNotification = 1201; | ||||
|   static const friendApplicationRejectedNotification = 1202; | ||||
|   static const friendApplicationNotification = 1203; | ||||
|   static const friendAddedNotification = 1204; | ||||
|   static const friendDeletedNotification = 1205; | ||||
|   static const friendRemarkSetNotification = 1206; | ||||
|   static const blackAddedNotification = 1207; | ||||
|   static const blackDeletedNotification = 1208; | ||||
|   static const friendNotificationEnd = 1299; | ||||
|   static const conversationChangeNotification = 1300; | ||||
| 
 | ||||
|   /// | ||||
|   static const transfer_group_owner = 501; | ||||
|   static const create_group = 502; | ||||
|   // static const create_group = 503; | ||||
|   static const join_group = 504; | ||||
|   static const quit_group = 505; | ||||
|   static const set_group_info = 506; | ||||
|   static const accept_group_application = 507; | ||||
|   static const refuse_group_application = 508; | ||||
|   static const kick_group_member = 509; | ||||
|   static const invited_user_to_group = 510; | ||||
|   static const userNotificationBegin = 1301; | ||||
|   static const userInfoUpdatedNotification = 1303; | ||||
|   static const userNotificationEnd = 1399; | ||||
| 
 | ||||
|   static const groupNotificationBegin = 1500; | ||||
| 
 | ||||
|   static const groupCreatedNotification = 1501; | ||||
|   static const groupInfoSetNotification = 1502; | ||||
|   static const joinGroupApplicationNotification = 1503; | ||||
|   static const memberQuitNotification = 1504; | ||||
|   static const groupApplicationAcceptedNotification = 1505; | ||||
|   static const groupApplicationRejectedNotification = 1506; | ||||
|   static const groupOwnerTransferredNotification = 1507; | ||||
|   static const memberKickedNotification = 1508; | ||||
|   static const memberInvitedNotification = 1509; | ||||
|   static const memberEnterNotification = 1510; | ||||
|   static const groupNotificationEnd = 1599; | ||||
| 
 | ||||
|   static const signalingNotificationBegin = 1600; | ||||
|   static const signalingNotification = 1601; | ||||
|   static const signalingNotificationEnd = 1699; | ||||
|   static const notificationEnd = 2000; | ||||
| } | ||||
|  | ||||
| @ -162,6 +162,21 @@ class MessageManager { | ||||
|             "operationID": Utils.checkOperationID(operationID), | ||||
|           })); | ||||
| 
 | ||||
|   /// Mark group message as read | ||||
|   /// 标记群聊消息已读 | ||||
|   Future markGroupMessageAsRead({ | ||||
|     required String groupID, | ||||
|     required List<String> messageIDList, | ||||
|     String? operationID, | ||||
|   }) => | ||||
|       _channel.invokeMethod( | ||||
|           'markGroupMessageAsRead', | ||||
|           _buildParam({ | ||||
|             "messageIDList": messageIDList, | ||||
|             "groupID": groupID, | ||||
|             "operationID": Utils.checkOperationID(operationID), | ||||
|           })); | ||||
| 
 | ||||
|   /// Typing | ||||
|   /// 正在输入提示 | ||||
|   Future typingStatusUpdate({ | ||||
|  | ||||
| @ -83,6 +83,18 @@ class SignalingManager { | ||||
|             'operationID': Utils.checkOperationID(operationID), | ||||
|           })); | ||||
| 
 | ||||
|   /// 挂断 | ||||
|   Future<dynamic> signalingHungUp({ | ||||
|     required SignalingInfo info, | ||||
|     String? operationID, | ||||
|   }) => | ||||
|       _channel.invokeMethod( | ||||
|           'signalingHungUp', | ||||
|           _buildParam({ | ||||
|             'signalingInfo': info.toJson(), | ||||
|             'operationID': Utils.checkOperationID(operationID), | ||||
|           })); | ||||
| 
 | ||||
|   static Map _buildParam(Map param) { | ||||
|     param["ManagerName"] = "signalingManager"; | ||||
|     return param; | ||||
|  | ||||
| @ -37,6 +37,7 @@ class Message { | ||||
|   MergeElem? mergeElem; | ||||
|   NotificationElem? notificationElem; | ||||
|   FaceElem? faceElem; | ||||
|   AttachedInfoElem? attachedInfoElem; | ||||
| 
 | ||||
|   Message({ | ||||
|     this.clientMsgID, | ||||
| @ -71,6 +72,7 @@ class Message { | ||||
|     this.mergeElem, | ||||
|     this.notificationElem, | ||||
|     this.faceElem, | ||||
|     this.attachedInfoElem, | ||||
|   }); | ||||
| 
 | ||||
|   Message.fromJson(Map<String, dynamic> json) { | ||||
| @ -127,6 +129,9 @@ class Message { | ||||
|         : null; | ||||
|     faceElem = | ||||
|         json['faceElem'] != null ? FaceElem.fromJson(json['faceElem']) : null; | ||||
|     attachedInfoElem = json['attachedInfoElem'] != null | ||||
|         ? AttachedInfoElem.fromJson(json['attachedInfoElem']) | ||||
|         : null; | ||||
|   } | ||||
| 
 | ||||
|   Map<String, dynamic> toJson() { | ||||
| @ -163,6 +168,7 @@ class Message { | ||||
|     data['mergeElem'] = this.mergeElem?.toJson(); | ||||
|     data['notificationElem'] = this.notificationElem?.toJson(); | ||||
|     data['faceElem'] = this.faceElem?.toJson(); | ||||
|     data['attachedInfoElem'] = this.attachedInfoElem?.toJson(); | ||||
|     return data; | ||||
|   } | ||||
| 
 | ||||
| @ -209,6 +215,7 @@ class Message { | ||||
|     mergeElem = message.mergeElem; | ||||
|     notificationElem = message.notificationElem; | ||||
|     faceElem = message.faceElem; | ||||
|     attachedInfoElem = message.attachedInfoElem; | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| @ -572,6 +579,45 @@ class FaceElem { | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| class AttachedInfoElem { | ||||
|   GroupHasReadInfo? groupHasReadInfo; | ||||
| 
 | ||||
|   AttachedInfoElem({this.groupHasReadInfo}); | ||||
| 
 | ||||
|   AttachedInfoElem.fromJson(Map<String, dynamic> json) { | ||||
|     groupHasReadInfo = json['groupHasReadInfo'] == null | ||||
|         ? null | ||||
|         : GroupHasReadInfo.fromJson(json['groupHasReadInfo']); | ||||
|   } | ||||
| 
 | ||||
|   Map<String, dynamic> toJson() { | ||||
|     final data = Map<String, dynamic>(); | ||||
|     data['groupHasReadInfo'] = this.groupHasReadInfo?.toJson(); | ||||
|     return data; | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| class GroupHasReadInfo { | ||||
|   List<String>? hasReadUserIDList; | ||||
|   int? hasReadCount; | ||||
| 
 | ||||
|   GroupHasReadInfo.fromJson(Map<String, dynamic> json) { | ||||
|     if (json['hasReadUserIDList'] == null) { | ||||
|       hasReadUserIDList = <String>[]; | ||||
|     } else { | ||||
|       hasReadUserIDList = (json['hasReadUserIDList'] as List).cast<String>(); | ||||
|     } | ||||
|     hasReadCount = json['hasReadCount'] ?? 0; | ||||
|   } | ||||
| 
 | ||||
|   Map<String, dynamic> toJson() { | ||||
|     final data = Map<String, dynamic>(); | ||||
|     data['hasReadUserIDList'] = this.hasReadUserIDList; | ||||
|     data['hasReadCount'] = this.hasReadCount; | ||||
|     return data; | ||||
|   } | ||||
| } | ||||
| 
 | ||||
| class ReadReceiptInfo { | ||||
|   String? userID; | ||||
|   String? groupID; | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user