From f503ba50e32e0511658f39ba3f6a4aa48c05a9bc Mon Sep 17 00:00:00 2001
From: erlangzhang <erlangzhang@qq.com>
Date: Sat, 9 Oct 2021 01:28:21 +0800
Subject: [PATCH] add ios conversion method

---
 .DS_Store                                     | Bin 8196 -> 0 bytes
 .gitignore                                    |   4 +
 example/ios/Runner.xcodeproj/project.pbxproj  |  68 +++++++++
 .../contents.xcworkspacedata                  |   3 +
 example/pubspec.lock                          |   2 +-
 ios/Classes/CommonUtil.swift                  |  16 +-
 ios/Classes/Module/ConversationManager.swift  |  17 +++
 ios/Classes/Module/MessageManager.swift       | 142 +++++++++---------
 ios/Classes/SwiftFlutterOpenimSdkPlugin.swift |  32 +++-
 9 files changed, 205 insertions(+), 79 deletions(-)
 delete mode 100644 .DS_Store
 create mode 100644 .gitignore

diff --git a/.DS_Store b/.DS_Store
deleted file mode 100644
index e2d591f0501f097c444ae8dd7274bac29477b4be..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 8196
zcmeHM-EI;=6g~qeORXsvM!7NB8}G1z)=0Q8p|nJs_!lvHp{8X4g>=~^>>{>^;oc|E
z3tz$K@Cketuk<@JQ?l%~-WY8YXPTLBcIG=fJKvev;cSUW)W@ANQGtjoWXAj@6elF^
z=bT6>-I50i*c18Gr_QeHw;eaZHVsArqkvJsC}0#Y3Y-T8aAtF|PC55guPKcJMuGoQ
z0e(N&$c#0ObA|HNfkK7=zzmvYLY>0_wy`zVG|m;G2T3SXpfVLY#1P6H?Y8FCG|m+&
za}qlE5PD>xBNQP=$Ng<dCs9*qN~3^LAgKUvmn^l&qYjOt@w@M!hkLh>*MG`{T7vCN
zf}!I|_BUtf_Jgog`YuxG%!P|t%UZEkF0Z_5_WVgRY=z^X-Wt8&tH-Ud=ji%V-**@F
zmh-INo$TeWZ2Ml=>U-UhH12o0puBwE_d5Qh?vK4rAn(&u9hQ}|a(ns0bXqM{i*~tO
zofYkAb)!_YZ*AV5&2rYY8|6E@`-8)y>HFD-PjVt8^t*)C)b*nLoSf#{=E!q>?+tp`
zYL&L>9;A6lcd0@5=@D?92FD*i7UF#ccUinHy@T8X8j?$0^{M2TEw0DdSLroaV+!%t
zg?skkpdo4=KC=vP6~Ji+7?-cy*u6f+?v)11ry$1qkzl#tIm@gR&pJAbG@c5qbLRTZ
zN~LITY*zl*^?G_SmuKPTUAVmgr#GpwERozLUn09?6^<H{0~fKw+HjH!`P+05v*QKw
zd%HuqT;lHKr4qHv(Gxt`7VXdj;0a4n@Pde1ti>#js7E*Pgx-nPyilUn8M!0_3YX_2
zmr9g}%~FFYZ<@J6wdu_H&uW-t6gWEt(rV}e$N!DfzyF`z1DcVI0!D$qu7JqwG<WJ4
zMjg$`@i^ADk@t}~F>kI=nxJ3`x65!GxcG-5>bCByX`CxW50d#IAZ0LxQQ)5{@C$Z}
BIf4KH

diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..9bb4589
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+.DS_Store
+/.packages
+/.dart_tool
+/example/ios/Podfile.lock
diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj
index 33f0685..58752cf 100644
--- a/example/ios/Runner.xcodeproj/project.pbxproj
+++ b/example/ios/Runner.xcodeproj/project.pbxproj
@@ -9,6 +9,7 @@
 /* Begin PBXBuildFile section */
 		1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; };
 		3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; };
+		6F7F8B794B6D663E7A65A104 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1971A63CCEC4B744C25980F8 /* Pods_Runner.framework */; };
 		74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; };
 		97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; };
 		97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; };
@@ -29,12 +30,16 @@
 /* End PBXCopyFilesBuildPhase section */
 
 /* Begin PBXFileReference section */
+		076751BE520B721535096B75 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = "<group>"; };
 		1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = "<group>"; };
 		1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = "<group>"; };
+		1971A63CCEC4B744C25980F8 /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+		3A6AB9CCD90A2F5C2CE719D0 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = "<group>"; };
 		3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = "<group>"; };
 		74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = "<group>"; };
 		74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
 		7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = "<group>"; };
+		7CF14C3CACE83F04F858C9EC /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = "<group>"; };
 		9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = "<group>"; };
 		9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = "<group>"; };
 		97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; };
@@ -49,12 +54,21 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				6F7F8B794B6D663E7A65A104 /* Pods_Runner.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 /* End PBXFrameworksBuildPhase section */
 
 /* Begin PBXGroup section */
+		4B877210D623EE0FDE18A08F /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				1971A63CCEC4B744C25980F8 /* Pods_Runner.framework */,
+			);
+			name = Frameworks;
+			sourceTree = "<group>";
+		};
 		9740EEB11CF90186004384FC /* Flutter */ = {
 			isa = PBXGroup;
 			children = (
@@ -72,6 +86,8 @@
 				9740EEB11CF90186004384FC /* Flutter */,
 				97C146F01CF9000F007C117D /* Runner */,
 				97C146EF1CF9000F007C117D /* Products */,
+				E653626F5A38799455FF26C4 /* Pods */,
+				4B877210D623EE0FDE18A08F /* Frameworks */,
 			);
 			sourceTree = "<group>";
 		};
@@ -98,6 +114,17 @@
 			path = Runner;
 			sourceTree = "<group>";
 		};
+		E653626F5A38799455FF26C4 /* Pods */ = {
+			isa = PBXGroup;
+			children = (
+				7CF14C3CACE83F04F858C9EC /* Pods-Runner.debug.xcconfig */,
+				3A6AB9CCD90A2F5C2CE719D0 /* Pods-Runner.release.xcconfig */,
+				076751BE520B721535096B75 /* Pods-Runner.profile.xcconfig */,
+			);
+			name = Pods;
+			path = Pods;
+			sourceTree = "<group>";
+		};
 /* End PBXGroup section */
 
 /* Begin PBXNativeTarget section */
@@ -105,12 +132,14 @@
 			isa = PBXNativeTarget;
 			buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */;
 			buildPhases = (
+				FA9CAD2EF743D14467F7D993 /* [CP] Check Pods Manifest.lock */,
 				9740EEB61CF901F6004384FC /* Run Script */,
 				97C146EA1CF9000F007C117D /* Sources */,
 				97C146EB1CF9000F007C117D /* Frameworks */,
 				97C146EC1CF9000F007C117D /* Resources */,
 				9705A1C41CF9048500538489 /* Embed Frameworks */,
 				3B06AD1E1E4923F5004D2608 /* Thin Binary */,
+				215A1CA82008A326A8ECBF65 /* [CP] Embed Pods Frameworks */,
 			);
 			buildRules = (
 			);
@@ -169,6 +198,23 @@
 /* End PBXResourcesBuildPhase section */
 
 /* Begin PBXShellScriptBuildPhase section */
+		215A1CA82008A326A8ECBF65 /* [CP] Embed Pods Frameworks */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputFileListPaths = (
+				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist",
+			);
+			name = "[CP] Embed Pods Frameworks";
+			outputFileListPaths = (
+				"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist",
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n";
+			showEnvVarsInLog = 0;
+		};
 		3B06AD1E1E4923F5004D2608 /* Thin Binary */ = {
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
@@ -197,6 +243,28 @@
 			shellPath = /bin/sh;
 			shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build";
 		};
+		FA9CAD2EF743D14467F7D993 /* [CP] Check Pods Manifest.lock */ = {
+			isa = PBXShellScriptBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			inputFileListPaths = (
+			);
+			inputPaths = (
+				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+				"${PODS_ROOT}/Manifest.lock",
+			);
+			name = "[CP] Check Pods Manifest.lock";
+			outputFileListPaths = (
+			);
+			outputPaths = (
+				"$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt",
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+			shellPath = /bin/sh;
+			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+			showEnvVarsInLog = 0;
+		};
 /* End PBXShellScriptBuildPhase section */
 
 /* Begin PBXSourcesBuildPhase section */
diff --git a/example/ios/Runner.xcworkspace/contents.xcworkspacedata b/example/ios/Runner.xcworkspace/contents.xcworkspacedata
index 1d526a1..21a3cc1 100644
--- a/example/ios/Runner.xcworkspace/contents.xcworkspacedata
+++ b/example/ios/Runner.xcworkspace/contents.xcworkspacedata
@@ -4,4 +4,7 @@
    <FileRef
       location = "group:Runner.xcodeproj">
    </FileRef>
+   <FileRef
+      location = "group:Pods/Pods.xcodeproj">
+   </FileRef>
 </Workspace>
diff --git a/example/pubspec.lock b/example/pubspec.lock
index 0414514..4ac48f3 100644
--- a/example/pubspec.lock
+++ b/example/pubspec.lock
@@ -68,7 +68,7 @@ packages:
       path: ".."
       relative: true
     source: path
-    version: "0.0.6"
+    version: "0.0.8+1"
   flutter_test:
     dependency: "direct dev"
     description: flutter
diff --git a/ios/Classes/CommonUtil.swift b/ios/Classes/CommonUtil.swift
index 310d67e..e3b31ce 100644
--- a/ios/Classes/CommonUtil.swift
+++ b/ios/Classes/CommonUtil.swift
@@ -179,6 +179,11 @@ public class CommonUtil {
         let result: String = getParamValue(methodCall: methodCall, param: KEY_SINGLE_MESSAGE_USERID) as! String
         return result
     }
+
+    public static func getUserid(methodCall: FlutterMethodCall)->String{
+        let result: String = getParamValue(methodCall: methodCall, param: KEY_SINGLE_MESSAGE_USERID) as! String
+        return result
+    }
     
     public static func getGroupMessageGroupid(methodCall: FlutterMethodCall)->String{
         let result: String = getParamValue(methodCall: methodCall, param: KEY_GROUP_MESSAGE_GROUPID) as! String
@@ -190,11 +195,16 @@ public class CommonUtil {
         return result
     }
     
-    public static func getFindMessageIds(methodCall: FlutterMethodCall)->String{
-        let result = getParamValue(methodCall: methodCall, param: KEY_FIND_MESSAGE_IDS) as AnyObject
+    public static func getMessageIds(methodCall: FlutterMethodCall)->String{
+        let result = getParamValue(methodCall: methodCall, param: KEY_MESSAGE_IDS) as AnyObject
         let r = JsonUtil.toString(object: result)
         return r
     }
+
+    public static func getTyping(methodCall: FlutterMethodCall)->String {
+        let result: String = getParamValue(methodCall: methodCall, param: "typing") as! String
+        return result
+    }
     
     public static func getConversationId(methodCall: FlutterMethodCall)->String{
         let result: String = getParamValue(methodCall: methodCall, param: KEY_CONVERSATION_ID) as! String
@@ -303,7 +313,7 @@ public class CommonUtil {
     //group chat
     private static let KEY_GROUP_MESSAGE_GROUPID: String = "groupID";
     // find message
-    private static let KEY_FIND_MESSAGE_IDS: String = "messageIDList";
+    private static let KEY_MESSAGE_IDS: String = "messageIDList";
     // conversation
     private static let KEY_CONVERSATION_ID: String = "conversationID";
     private static let KEY_CONVERSATION_IDS: String = "conversationIDList";
diff --git a/ios/Classes/Module/ConversationManager.swift b/ios/Classes/Module/ConversationManager.swift
index bb33644..0f4af6d 100644
--- a/ios/Classes/Module/ConversationManager.swift
+++ b/ios/Classes/Module/ConversationManager.swift
@@ -42,6 +42,23 @@ public class ConversationManager:NSObject{
     func pinConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
         Open_im_sdkPinConversation(CommonUtil.getConversationId(methodCall: methodCall), CommonUtil.isPinnedConversation(methodCall: methodCall), BaseImpl(result: result))
     }
+
+    func markSingleMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
+        Open_im_sdkMarkSingleMessageHasRead(BaseImpl(result: result), CommonUtil.getSingleMessageUserid(methodCall: methodCall))
+    }
+
+    func markGroupMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
+        Open_im_sdkMarkGroupMessageHasRead(BaseImpl(result: result), CommonUtil.getGroupMessageGroupid(methodCall: methodCall))
+    }
+
+    func getTotalUnreadMsgCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
+        Open_im_sdkGetTotalUnreadMsgCount(BaseImpl(result: result))
+    }
+
+    func getConversationIDBySessionType(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
+        let conversationID = Open_im_sdkGetConversationIDBySessionType(CommonUtil.getConversationSourceId(methodCall: methodCall), CommonUtil.getConversationSessionType(methodCall: methodCall))
+        DispatchQueue.main.async { result(conversationID) }
+    }
 }
 
 
diff --git a/ios/Classes/Module/MessageManager.swift b/ios/Classes/Module/MessageManager.swift
index d1f7852..89770a0 100644
--- a/ios/Classes/Module/MessageManager.swift
+++ b/ios/Classes/Module/MessageManager.swift
@@ -62,7 +62,6 @@ public class MessageManager:NSObject{
     }
     
     func deleteMessages(methodCall: FlutterMethodCall, result: FlutterResult){
-
     }
     
     func insertSingleMessageToLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@@ -70,11 +69,18 @@ public class MessageManager:NSObject{
     }
     
     func findMessages(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
-        Open_im_sdkFindMessages(BaseImpl(result: result), CommonUtil.getFindMessageIds(methodCall: methodCall))
+        Open_im_sdkFindMessages(BaseImpl(result: result), CommonUtil.getMessageIds(methodCall: methodCall))
     }
-    
-    func markSingleMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
-        Open_im_sdkMarkSingleMessageHasRead(BaseImpl(result: result), CommonUtil.getSingleMessageUserid(methodCall: methodCall))
+
+    func markC2CMessageAsRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
+        Open_im_sdkMarkC2CMessageAsRead(BaseImpl(result: result), CommonUtil.getUserid(methodCall: methodCall), CommonUtil.getMessageIds(methodCall: methodCall))
+    }
+
+    func typingStatusUpdate(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
+        let receiver = CommonUtil.getUserid(methodCall: methodCall)
+        let typing = CommonUtil.getTyping(methodCall: methodCall)
+        Open_im_sdkTypingStatusUpdate(receiver, typing)
+        DispatchQueue.main.async { result(nil) }
     }
 
     func markGroupMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
@@ -121,76 +127,70 @@ public class MessageManager:NSObject{
         DispatchQueue.main.async { result(prama) }
     }
 
-    func getTotalUnreadMsgCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
-        Open_im_sdkGetTotalUnreadMsgCount(BaseImpl(result: result))
-    }
-
     func forceSyncMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
         Open_im_sdkForceSyncMsg()
-}
-
-public class SendMsgProgressListener:NSObject, Open_im_sdkSendMsgCallBackProtocol {
-    
-    private let channel: FlutterMethodChannel
-    private var result: FlutterResult?
-    private var call: FlutterMethodCall?
-    private let values: NSMutableDictionary = NSMutableDictionary(capacity: 0)
-    
-    init(channel: FlutterMethodChannel) {
-        self.channel = channel
     }
-    
-    func setResult(result: @escaping FlutterResult){
-        self.result = result
-    }
-    
-    func setCall(methodCall: FlutterMethodCall){
-        self.call = methodCall
-    }
-    
-    public func onError(_ errCode: Int, errMsg: String?) {
-        print("=================onError============\nerrcode:\(errCode),errMsg:\(errMsg!)");
-        DispatchQueue.main.async { self.result!(FlutterError(code: "\(errCode)", message: errMsg, details: nil)) }
-    }
-    
-    public func onProgress(_ progress: Int) {
-        print("=================onProgress============\nprogress:\(progress)");
-        values.setValue(CommonUtil.getSendMessageClientMsgID(methodCall: self.call!), forKey: "clientMsgID")
-        values.setValue(progress, forKey: "progress")
-        CommonUtil.emitEvent(channel: channel, method: "msgSendProgressListener", type: "onProgress", errCode: nil, errMsg: nil, data: values)
-    }
-    
-    public func onSuccess(_ data: String?) {
-        print("=================onSuccess============\nsuccess:\(data!)");
-        DispatchQueue.main.async { self.result!(data) }
-    }
-    
-}
 
-public class AdvancedMsgListener: NSObject, Open_im_sdkOnAdvancedMsgListenerProtocol {
-    private let channel: FlutterMethodChannel
-    private let values: NSMutableDictionary = NSMutableDictionary(capacity: 0)
-    
-    init(channel: FlutterMethodChannel, id: String) {
-        self.channel = channel
-        values.setValue(id, forKey: "id")
-    }
-    
-    public func onRecvC2CReadReceipt(_ msgReceiptList: String?) {
-        values.setValue(msgReceiptList, forKey: "message")
-        CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvC2CReadReceipt", errCode: nil, errMsg: nil, data: values)
-    }
-    
-    public func onRecvMessageRevoked(_ msgId: String?) {
-        values.setValue(msgId, forKey: "message")
-        CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageRevoked", errCode: nil, errMsg: nil, data: values)
+    public class SendMsgProgressListener:NSObject, Open_im_sdkSendMsgCallBackProtocol {
+
+        private let channel: FlutterMethodChannel
+        private var result: FlutterResult?
+        private var call: FlutterMethodCall?
+        private let values: NSMutableDictionary = NSMutableDictionary(capacity: 0)
+
+        init(channel: FlutterMethodChannel) {
+            self.channel = channel
+        }
+
+        func setResult(result: @escaping FlutterResult){
+            self.result = result
+        }
+
+        func setCall(methodCall: FlutterMethodCall){
+            self.call = methodCall
+        }
+
+        public func onError(_ errCode: Int, errMsg: String?) {
+            print("=================onError============\nerrcode:\(errCode),errMsg:\(errMsg!)");
+            DispatchQueue.main.async { self.result!(FlutterError(code: "\(errCode)", message: errMsg, details: nil)) }
+        }
+
+        public func onProgress(_ progress: Int) {
+            print("=================onProgress============\nprogress:\(progress)");
+            values.setValue(CommonUtil.getSendMessageClientMsgID(methodCall: self.call!), forKey: "clientMsgID")
+            values.setValue(progress, forKey: "progress")
+            CommonUtil.emitEvent(channel: channel, method: "msgSendProgressListener", type: "onProgress", errCode: nil, errMsg: nil, data: values)
+        }
+
+        public func onSuccess(_ data: String?) {
+            print("=================onSuccess============\nsuccess:\(data!)");
+            DispatchQueue.main.async { self.result!(data) }
+        }
+
     }
-    
-    public func onRecvNewMessage(_ message: String?) {
-        values.setValue(message, forKey: "message")
-        CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvNewMessage", errCode: nil, errMsg: nil, data: values)
+
+    public class AdvancedMsgListener: NSObject, Open_im_sdkOnAdvancedMsgListenerProtocol {
+        private let channel: FlutterMethodChannel
+        private let values: NSMutableDictionary = NSMutableDictionary(capacity: 0)
+
+        init(channel: FlutterMethodChannel, id: String) {
+            self.channel = channel
+            values.setValue(id, forKey: "id")
+        }
+
+        public func onRecvC2CReadReceipt(_ msgReceiptList: String?) {
+            values.setValue(msgReceiptList, forKey: "message")
+            CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvC2CReadReceipt", errCode: nil, errMsg: nil, data: values)
+        }
+
+        public func onRecvMessageRevoked(_ msgId: String?) {
+            values.setValue(msgId, forKey: "message")
+            CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageRevoked", errCode: nil, errMsg: nil, data: values)
+        }
+
+        public func onRecvNewMessage(_ message: String?) {
+            values.setValue(message, forKey: "message")
+            CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvNewMessage", errCode: nil, errMsg: nil, data: values)
+        }
     }
-    
-    
-}
 }
diff --git a/ios/Classes/SwiftFlutterOpenimSdkPlugin.swift b/ios/Classes/SwiftFlutterOpenimSdkPlugin.swift
index f70bdfa..6d2417e 100644
--- a/ios/Classes/SwiftFlutterOpenimSdkPlugin.swift
+++ b/ios/Classes/SwiftFlutterOpenimSdkPlugin.swift
@@ -81,6 +81,14 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
             conversationManager.setConversationDraft(methodCall: call, result: result)
         }else if method == "pinConversation" {
             conversationManager.pinConversation(methodCall: call, result: result)
+        }else if method == "markSingleMessageHasRead" {
+            conversationManager.markSingleMessageHasRead(methodCall: call, result: result)
+        }else if method == "markGroupMessageHasRead" {
+            conversationManager.markGroupMessageHasRead(methodCall: call, result: result)
+        }else if method == "getTotalUnreadMsgCount" {
+            conversationManager.getTotalUnreadMsgCount(methodCall: call, result: result)
+        }else if method == "getConversationIDBySessionType" {
+            conversationManager.getConversationIDBySessionType(methodCall: call, result: result)
         }else{
             print("Handle MethodName Error: ConversationManager method: \(method)  not found")
         }
@@ -145,26 +153,42 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
             messageManager.insertSingleMessageToLocalStorage(methodCall: call, result: result)
         }else if method == "findMessages" {
             messageManager.findMessages(methodCall: call, result: result)
-        }else if method == "markSingleMessageHasRead" {
-            messageManager.markSingleMessageHasRead(methodCall: call, result: result)
+        }else if method == "markC2CMessageAsRead" {
+            messageManager.markC2CMessageAsRead(methodCall: call, result: result)
+        }else if method == "typingStatusUpdate" {
+            messageManager.typingStatusUpdate(methodCall: call, result: result)
         }else if method == "createTextMessage" {
             messageManager.createTextMessage(methodCall: call, result: result)
         }else if method == "createTextAtMessage" {
             messageManager.createTextAtMessage(methodCall: call, result: result)
         }else if method == "createImageMessage" {
             messageManager.createImageMessage(methodCall: call, result: result)
+        }else if method == "createImageMessageFromFullPath" {
+            // TODO:
         }else if method == "createSoundMessage" {
             messageManager.createSoundMessage(methodCall: call, result: result)
+        }else if method == "createSoundMessageFromFullPath" {
+            // TODO:
         }else if method == "createVideoMessage" {
             messageManager.createVideoMessage(methodCall: call, result: result)
+        }else if method == "createVideoMessageFromFullPath" {
+            // TODO:
         }else if method == "createFileMessage" {
             messageManager.createFileMessage(methodCall: call, result: result)
         }else if method == "createMergerMessage" {
             messageManager.createMergerMessage(methodCall: call, result: result)
         }else if method == "createForwardMessage" {
             messageManager.createForwardMessage(methodCall: call, result: result)
-        }else if method == "getTotalUnreadMsgCount" {
-            messageManager.getTotalUnreadMsgCount(methodCall: call, result: result)
+        }else if method == "createLocationMessage" {
+            // TODO:
+        }else if method == "createCustomMessage" {
+            // TODO:
+        }else if method == "createQuoteMessage" {
+            // TODO:
+        }else if method == "createCardMessage" {
+            // TODO:
+        }else if method == "forceSyncMsg" {
+            // TODO:
         }else{
             print("Handle MethodName Error: MessageManager method: \(method)  not found")
         }