new add ios support

This commit is contained in:
hrxiang
2021-07-06 11:39:31 +08:00
parent d613703524
commit 073b91ba99
47 changed files with 4554 additions and 170 deletions

View File

@@ -0,0 +1,344 @@
//
// CommonUtil.swift
// Runner
//
// Created by z1u24 on 2021/6/28.
//
import Foundation
public class CommonUtil {
public static func getParamValue(methodCall:FlutterMethodCall, param: String)->Any? {
let argument = methodCall.arguments as! NSDictionary
let arg = argument.value(forKey: param)
return arg;
}
public static func getSDKJsonParam(methodCall: FlutterMethodCall, key: String) -> String{
let argument = methodCall.arguments as! NSDictionary
let arg = argument.value(forKey: key) as AnyObject
return JsonUtil.toString(object: arg);
}
public static func getSDKJsonParam(methodCall: FlutterMethodCall) -> String{
let argument = methodCall.arguments as AnyObject
let s = JsonUtil.toString(object: argument)
return s
}
public static func emitEvent(channel: FlutterMethodChannel, method: String, type: String, errCode: Int?, errMsg: String?, data: Any?){
DispatchQueue.main.async {
let res: NSMutableDictionary = NSMutableDictionary(capacity: 0)
res.setValue(type, forKey: "type")
if (data != nil) {
res.setValue(data, forKey: "data");
}
if (nil != errCode) {
res.setValue(errCode, forKey: "errCode");
}
if (nil != errMsg) {
res.setValue(errMsg, forKey: "errMsg");
}
print("native call flutter { method: \(method) type: \(type) }")
channel.invokeMethod(method, arguments: res)
}
}
public static func getUid(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_LOGIN_UID) as! String
return result
}
public static func getToken(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_LOGIN_TOKEN) as! String
return result
}
public static func getUidList(methodCall: FlutterMethodCall)->String{
let result = getParamValue(methodCall: methodCall, param: KEY_UID_LIST) as AnyObject
let r = JsonUtil.toString(object: result)
return r
}
public static func getUserUid(methodCall: FlutterMethodCall)->String{
let result = getParamValue(methodCall: methodCall, param: KEY_LOGIN_UID) as AnyObject
let r = JsonUtil.toString(object: result)
return r
}
public static func getDeleteUid(methodCall: FlutterMethodCall)->String{
let result = getParamValue(methodCall: methodCall, param: KEY_DELETE_UID) as AnyObject
let r = JsonUtil.toString(object: result)
return r
}
public static func getMessageText(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_TEXT) as! String
return result
}
public static func getAtUserList(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_AT_USER_LIST) as! String
return result
}
public static func getImagePath(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_IMAGE_PATH) as! String
return result
}
public static func getSoundPath(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_SOUND_PATH) as! String
return result
}
public static func getSoundDuration(methodCall: FlutterMethodCall)->Int64{
let result: Int64 = getParamValue(methodCall: methodCall, param: KEY_SOUND_DURATION) as! Int64
return result
}
public static func getVideoPath(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_VIDEO_PATH) as! String
return result
}
public static func getVideoType(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_VIDEO_TYPE) as! String
return result
}
public static func getVideoDuration(methodCall: FlutterMethodCall)->Int64{
let result: Int64 = getParamValue(methodCall: methodCall, param: KEY_VIDEO_DURATION) as! Int64
return result
}
public static func getVideoSnapshotPath(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_VIDEO_SNAPSHOT_PATH) as! String
return result
}
public static func getFilePath(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_FILE_PATH) as! String
return result
}
public static func getFileName(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_FILE_NAME) as! String
return result
}
public static func getMergerMessageList(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_MERGER_MESSAGE_LIST) as! String
return result
}
public static func getMergerMessageTitle(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_MERGER_MESSAGE_TITLE) as! String
return result
}
public static func getSummaryList(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_SUMMARY_LIST) as! String
return result
}
public static func getForwardMessage(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_FORWARD_MESSAGE) as! String
return result
}
public static func getSendMessageContent(methodCall: FlutterMethodCall)->String{
let result = getParamValue(methodCall: methodCall, param: KEY_SEND_MESSAGE_CONTENT)
if result is NSDictionary && result != nil {
return JsonUtil.toString(object: result as? NSDictionary)
}
return result as! String
}
public static func getSendMessageClientMsgID(methodCall: FlutterMethodCall)->String{
let r = getParamValue(methodCall: methodCall, param: KEY_SEND_MESSAGE_CONTENT) as! NSDictionary
let result = r.value(forKey: KEY_SEND_MESSAGE_CONTENT_CLIENT_ID)
return result as! String
}
public static func getSendMessageReceiver(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_SEND_MESSAGE_RECEIVER) as! String
return result
}
public static func getSendMessageGroupId(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_SEND_MESSAGE_GROUP_ID) as! String
return result
}
public static func getSendMessageOnlineOnly(methodCall: FlutterMethodCall)->Bool{
let result: Int = getParamValue(methodCall: methodCall, param: KEY_SEND_MESSAGE_ONLINE_ONLY) as! Int
return (result != 0)
}
public static func getSingleMessageContent(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_SINGLE_MESSAGE_CONTENT) as! String
return result
}
public static func getSingleMessageUserid(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_SINGLE_MESSAGE_USERID) as! String
return result
}
public static func getSingleMessageSender(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_SINGLE_MESSAGE_SENDER) as! String
return result
}
public static func getFindMessageIds(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_FIND_MESSAGE_IDS) as! String
return result
}
public static func getConversationId(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_CONVERSATION_ID) as! String
return result
}
public static func getConversationIds(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_CONVERSATION_IDS) as! String
return result
}
public static func getConversationDraft(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_CONVERSATION_DRAFT) as! String
return result
}
public static func isPinnedConversation(methodCall: FlutterMethodCall)->Bool{
let result: Int = getParamValue(methodCall: methodCall, param: KEY_SINGLE_MESSAGE_USERID) as! Int
return (result != 0)
}
public static func getSessionType(methodCall: FlutterMethodCall)->Int{
let result: Int = getParamValue(methodCall: methodCall, param: KEY_CONVERSATION_SESSION) as! Int
return result
}
/**
* group
*/
public static func getGroupId(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_GROUP_ID) as! String
return result
}
public static func getGroupReason(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_GROUP_REASON) as! String
return result
}
public static func getGroupUserList(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_GROUP_USERLIST) as! String
return result
}
public static func getGroupFilter(methodCall: FlutterMethodCall)->Int32{
let result: Int32 = getParamValue(methodCall: methodCall, param: KEY_GROUP_FILTER) as! Int32
return result
}
public static func getGroupNext(methodCall: FlutterMethodCall)->Int32{
let result: Int32 = getParamValue(methodCall: methodCall, param: KEY_GROUP_NEXT) as! Int32
return result
}
public static func getGroupInfo(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_GROUP_INFO) as! String
return result
}
public static func getGroupMemberList(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_GROUP_MEMBERLIST) as! String
return result
}
public static func getGroupJsonInfo(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_GROUP_JSONINFO) as! String
return result
}
public static func getGroupIdList(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_GROUP_IDLIST) as! String
return result
}
public static func getGroupMessage(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_GROUP_MESSAGE) as! String
return result
}
public static func getGroupUserId(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_USER_ID) as! String
return result
}
public static func getGroupApplication(methodCall: FlutterMethodCall)->String{
let result: String = getParamValue(methodCall: methodCall, param: KEY_GROUP_APPLICATION) as! String
return result
}
//login
private static let KEY_LOGIN_UID: String = "uid";
private static let KEY_LOGIN_TOKEN: String = "token";
//userinfo
private static let KEY_UID_LIST: String = "uidList";
private static let KEY_DELETE_UID: String = "deleteUid";
//create message body
private static let KEY_TEXT: String = "text";
private static let KEY_AT_USER_LIST: String = "atUserList";
private static let KEY_IMAGE_PATH: String = "imagePath";
private static let KEY_SOUND_PATH: String = "soundPath";
private static let KEY_SOUND_DURATION: String = "duration";
private static let KEY_VIDEO_PATH: String = "videoPath";
private static let KEY_VIDEO_TYPE: String = "videoType";
private static let KEY_VIDEO_DURATION: String = "duration";
private static let KEY_VIDEO_SNAPSHOT_PATH: String = "snapshotPath";
private static let KEY_FILE_PATH: String = "filePath";
private static let KEY_FILE_NAME: String = "fileName";
private static let KEY_MERGER_MESSAGE_LIST: String = "messageList";
private static let KEY_MERGER_MESSAGE_TITLE: String = "title";
private static let KEY_SUMMARY_LIST: String = "summaryList";
private static let KEY_FORWARD_MESSAGE: String = "message";
//send message
private static let KEY_SEND_MESSAGE_CONTENT: String = "message";
private static let KEY_SEND_MESSAGE_CONTENT_CLIENT_ID: String = "clientMsgID";
private static let KEY_SEND_MESSAGE_RECEIVER: String = "receiver";
private static let KEY_SEND_MESSAGE_GROUP_ID: String = "groupID";
private static let KEY_SEND_MESSAGE_ONLINE_ONLY: String = "onlineUserOnly";
//single chat
private static let KEY_SINGLE_MESSAGE_CONTENT: String = "message";
private static let KEY_SINGLE_MESSAGE_USERID: String = "userID";
private static let KEY_SINGLE_MESSAGE_SENDER: String = "sender";
// find message
private static let KEY_FIND_MESSAGE_IDS: String = "messageIDList";
// conversation
private static let KEY_CONVERSATION_ID: String = "conversationID";
private static let KEY_CONVERSATION_IDS: String = "conversationIDList";
private static let KEY_CONVERSATION_DRAFT: String = "draftText";
private static let KEY_CONVERSATION_PINNED: String = "isPinned";
private static let KEY_CONVERSATION_SESSION: String = "sessionType";
//group
private static let KEY_GROUP_ID: String = "groupid";
private static let KEY_GROUP_USERLIST: String = "userList";
private static let KEY_GROUP_REASON: String = "reason";
private static let KEY_GROUP_FILTER: String = "filter";
private static let KEY_GROUP_NEXT: String = "next";
private static let KEY_GROUP_INFO: String = "gInfo";
private static let KEY_GROUP_MEMBERLIST: String = "memberList";
private static let KEY_GROUP_JSONINFO: String = "jsonGroupInfo";
private static let KEY_GROUP_IDLIST: String = "groupIdList";
private static let KEY_GROUP_MESSAGE: String = "message";
private static let KEY_USER_ID: String = "userId";
private static let KEY_GROUP_APPLICATION: String = "application";
}

View File

@@ -0,0 +1,27 @@
//
// JsonUtil.swift
// Runner
//
// Created by z1u24 on 2021/6/28.
//
import Foundation
public class JsonUtil {
public static func toString(object: AnyObject?)->String{
if object == nil {
return "";
}
if object is String{
let s = object as! String
let b = s.replacingOccurrences(of: "\"", with: "\\\"")
let a = "\"\(b)\""
return a
}
let data = try? JSONSerialization.data(withJSONObject: object!, options: JSONSerialization.WritingOptions.init(rawValue: 0))
let jsonStr = NSString(data: data!, encoding: String.Encoding.utf8.rawValue)
return jsonStr! as String
}
}

View File

@@ -0,0 +1,88 @@
//
// ConversationManager.swift
// Runner
//
// Created by z1u24 on 2021/6/29.
//
import Foundation
import OpenIMCore
public class ConversationManager:NSObject{
private let channel:FlutterMethodChannel
init(channel:FlutterMethodChannel) {
self.channel = channel
}
func setConversationListener(methodCall: FlutterMethodCall, result: FlutterResult){
Open_im_sdkSetConversationListener(ConversationListenerImpl(channel: channel))
}
func getAllConversationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetAllConversationList(BaseImpl(result: result))
}
func getOneConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetOneConversation(CommonUtil.getConversationId(methodCall: methodCall), CommonUtil.getSessionType(methodCall: methodCall), BaseImpl(result: result))
}
func getMultipleConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetMultipleConversation(CommonUtil.getConversationIds(methodCall: methodCall), BaseImpl(result: result))
}
func deleteConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkDeleteConversation(CommonUtil.getConversationId(methodCall: methodCall), BaseImpl(result: result))
}
func setConversationDraft(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetConversationDraft(CommonUtil.getConversationId(methodCall: methodCall), CommonUtil.getConversationDraft(methodCall: methodCall), BaseImpl(result: result))
}
func pinConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkPinConversation(CommonUtil.getConversationId(methodCall: methodCall), CommonUtil.isPinnedConversation(methodCall: methodCall), BaseImpl(result: result))
}
func getTotalUnreadMsgCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetTotalUnreadMsgCount(BaseImpl(result: result))
}
}
public class ConversationListenerImpl:NSObject,Open_im_sdkOnConversationListenerProtocol {
private let channel:FlutterMethodChannel
init(channel:FlutterMethodChannel) {
self.channel = channel
}
public func onConversationChanged(_ conversationList: String?) {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onConversationChanged", errCode: nil, errMsg: nil, data: conversationList)
}
public func onNewConversation(_ conversationList: String?) {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onNewConversation", errCode: nil, errMsg: nil, data: conversationList)
}
public func onSyncServerFailed() {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerFailed", errCode: nil, errMsg: nil, data: nil)
}
public func onSyncServerFinish() {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerFinish", errCode: nil, errMsg: nil, data: nil)
}
public func onSyncServerStart() {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerStart", errCode: nil, errMsg: nil, data: nil)
}
public func onTotalUnreadMessageCountChanged(_ totalUnreadCount: Int32) {
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onTotalUnreadMessageCountChanged", errCode: nil, errMsg: nil, data: totalUnreadCount)
}
}

View File

@@ -0,0 +1,126 @@
//
// FriendshipManager.swift
// Runner
//
// Created by z1u24 on 2021/6/29.
//
import Foundation
import OpenIMCore
public class FriendshipManager:NSObject{
private let channel:FlutterMethodChannel
init(channel:FlutterMethodChannel) {
self.channel = channel
}
func setFriendListener(methodCall: FlutterMethodCall, result: FlutterResult){
Open_im_sdkSetFriendListener(FriendshipListenerImpl(channel: channel))
}
func getFriendsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetFriendsInfo(BaseImpl(result: result), CommonUtil.getUidList(methodCall: methodCall))
}
func addFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkAddFriend(BaseImpl(result: result), CommonUtil.getSDKJsonParam(methodCall: methodCall))
}
func getFriendApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetFriendApplicationList(BaseImpl(result: result))
}
func getFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetFriendList(BaseImpl(result: result))
}
func setFriendInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetFriendInfo(CommonUtil.getSDKJsonParam(methodCall: methodCall), BaseImpl(result: result))
}
func addToBlackList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkAddToBlackList(BaseImpl(result: result), CommonUtil.getUserUid(methodCall: methodCall))
}
func getBlackList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetBlackList(BaseImpl(result: result))
}
func deleteFromBlackList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkDeleteFromBlackList(BaseImpl(result: result), CommonUtil.getUserUid(methodCall: methodCall))
}
func checkFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkCheckFriend(BaseImpl(result: result), CommonUtil.getUidList(methodCall: methodCall))
}
func deleteFromFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkDeleteFromFriendList(CommonUtil.getDeleteUid(methodCall: methodCall), BaseImpl(result: result))
}
func acceptFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkAcceptFriendApplication(BaseImpl(result: result), CommonUtil.getUid(methodCall: methodCall))
}
func refuseFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkRefuseFriendApplication(BaseImpl(result: result), CommonUtil.getUid(methodCall: methodCall))
}
func forceSyncFriendApplication(methodCall: FlutterMethodCall, result: FlutterResult){
Open_im_sdkForceSyncFriendApplication();
}
func forceSyncFriend(methodCall: FlutterMethodCall, result: FlutterResult){
Open_im_sdkForceSyncFriend()
}
func forceSyncBlackList(methodCall: FlutterMethodCall, result: FlutterResult){
Open_im_sdkForceSyncBlackList()
}
}
public class FriendshipListenerImpl:NSObject,Open_im_sdkOnFriendshipListenerProtocol {
private let channel:FlutterMethodChannel
init(channel:FlutterMethodChannel) {
self.channel = channel
}
public func onBlackListAdd(_ userInfo: String?) {
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlackListAdd", errCode: nil, errMsg: nil, data: userInfo)
}
public func onBlackListDeleted(_ userInfo: String?) {
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlackListDeleted", errCode: nil, errMsg: nil, data: userInfo)
}
public func onFriendApplicationListAccept(_ applyUserInfo: String?) {
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationListAccept", errCode: nil, errMsg: nil, data: applyUserInfo)
}
public func onFriendApplicationListAdded(_ applyUserInfo: String?) {
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationListAdded", errCode: nil, errMsg: nil, data: applyUserInfo)
}
public func onFriendApplicationListDeleted(_ applyUserInfo: String?) {
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationListDeleted", errCode: nil, errMsg: nil, data: applyUserInfo)
}
public func onFriendApplicationListReject(_ applyUserInfo: String?) {
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationListReject", errCode: nil, errMsg: nil, data: applyUserInfo)
}
public func onFriendInfoChanged(_ friendInfo: String?) {
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendInfoChanged", errCode: nil, errMsg: nil, data: friendInfo)
}
public func onFriendListAdded(_ friendInfo: String?) {
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendListAdded", errCode: nil, errMsg: nil, data: friendInfo)
}
public func onFriendListDeleted(_ friendInfo: String?) {
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendListDeleted", errCode: nil, errMsg: nil, data: friendInfo)
}
}

View File

@@ -0,0 +1,74 @@
//
// GroupManager.swift
// flutter_openim_sdk
//
// Created by z1u24 on 2021/7/5.
//
import Foundation
import OpenIMCore
public class GroupManager:NSObject{
private let channel:FlutterMethodChannel
init(channel:FlutterMethodChannel) {
self.channel = channel
}
func inviteUserToGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkInviteUserToGroup(CommonUtil.getGroupId(methodCall: methodCall), CommonUtil.getGroupReason(methodCall: methodCall), CommonUtil.getGroupUserList(methodCall: methodCall), BaseImpl(result: result))
}
func kickGroupMember(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkKickGroupMember(CommonUtil.getGroupId(methodCall: methodCall), CommonUtil.getGroupUserList(methodCall: methodCall), CommonUtil.getGroupReason(methodCall: methodCall), BaseImpl(result: result))
}
func getGroupMembersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetGroupMembersInfo(CommonUtil.getGroupId(methodCall: methodCall), CommonUtil.getGroupUserList(methodCall: methodCall), BaseImpl(result: result))
}
func getGroupMemberList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetGroupMemberList(CommonUtil.getGroupId(methodCall: methodCall), CommonUtil.getGroupFilter(methodCall: methodCall), CommonUtil.getGroupNext(methodCall: methodCall), BaseImpl(result: result))
}
func getJoinedGroupList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetJoinedGroupList(BaseImpl(result: result))
}
func createGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkCreateGroup(CommonUtil.getGroupInfo(methodCall: methodCall), CommonUtil.getGroupMemberList(methodCall: methodCall), BaseImpl(result: result))
}
func setGroupInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetGroupInfo(CommonUtil.getGroupJsonInfo(methodCall: methodCall), BaseImpl(result: result))
}
func getGroupsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetGroupsInfo(CommonUtil.getGroupIdList(methodCall: methodCall), BaseImpl(result: result))
}
func joinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkJoinGroup(CommonUtil.getGroupId(methodCall: methodCall), CommonUtil.getGroupMessage(methodCall: methodCall), BaseImpl(result: result))
}
func quitGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkQuitGroup(CommonUtil.getGroupId(methodCall: methodCall), BaseImpl(result: result))
}
func transferGroupOwner(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkTransferGroupOwner(CommonUtil.getGroupId(methodCall: methodCall), CommonUtil.getGroupUserId(methodCall: methodCall), BaseImpl(result: result))
}
func getGroupApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetGroupApplicationList(BaseImpl(result: result))
}
func acceptGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkAcceptGroupApplication(CommonUtil.getGroupApplication(methodCall: methodCall), CommonUtil.getGroupReason(methodCall: methodCall), BaseImpl(result: result))
}
func refuseGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkRefuseGroupApplication(CommonUtil.getGroupApplication(methodCall: methodCall), CommonUtil.getGroupReason(methodCall: methodCall), BaseImpl(result: result))
}
}

View File

@@ -0,0 +1,101 @@
//
// IMManager.swift
// Runner
//
// Created by z1u24 on 2021/6/28.
//
import Foundation
import OpenIMCore
public class IMMananger:NSObject{
private let channel:FlutterMethodChannel
init(channel:FlutterMethodChannel) {
self.channel = channel
}
func initSDK(methodCall: FlutterMethodCall, result: FlutterResult){
Open_im_sdkInitSDK(CommonUtil.getSDKJsonParam(methodCall: methodCall), SDKListenerImpl(channel: self.channel))
}
func login(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkLogin(CommonUtil.getUid(methodCall: methodCall), CommonUtil.getToken(methodCall: methodCall), BaseImpl(result: result))
}
func logout(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkLogout(BaseImpl(result: result))
}
func getLoginStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
DispatchQueue.main.async { result(Open_im_sdkGetLoginStatus()) }
}
func getLoginUid(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
DispatchQueue.main.async { result(Open_im_sdkGetLoginUser()) }
}
func getUsersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkGetUsersInfo(CommonUtil.getUidList(methodCall: methodCall), BaseImpl(result: result))
}
func setSelfInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkSetSelfInfo(CommonUtil.getSDKJsonParam(methodCall: methodCall), BaseImpl(result: result))
}
func forceSyncLoginUerInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
Open_im_sdkForceSyncLoginUerInfo()
}
}
public class SDKListenerImpl:NSObject,Open_im_sdkIMSDKListenerProtocol {
private let channel:FlutterMethodChannel
init(channel:FlutterMethodChannel) {
self.channel = channel
}
public func onConnectFailed(_ errCode: Int, errMsg: String?) {
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onConnectFailed", errCode: errCode, errMsg: errMsg, data: nil)
}
public func onConnectSuccess() {
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onConnectSuccess", errCode: nil, errMsg: nil, data: nil);
}
public func onConnecting() {
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onConnecting", errCode: nil, errMsg: nil, data: nil);
}
public func onKickedOffline() {
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onKickedOffline", errCode: nil, errMsg: nil, data: nil);
}
public func onSelfInfoUpdated(_ userInfo: String?) {
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onSelfInfoUpdated", errCode: nil, errMsg: nil, data: userInfo);
}
public func onUserTokenExpired() {
CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onUserTokenExpired", errCode: nil, errMsg: nil, data: nil);
}
}
public class BaseImpl:NSObject,Open_im_sdkBaseProtocol {
private let result:FlutterResult
init(result:@escaping FlutterResult) {
self.result = result
}
public func onError(_ errCode: Int, errMsg: String?) {
print("BaseImpl: " + errMsg!)
DispatchQueue.main.async { self.result(FlutterError(code: "\(errCode)", message: errMsg, details: nil)) }
}
public func onSuccess(_ data: String?) {
DispatchQueue.main.async { self.result(data) }
}
}

View File

@@ -0,0 +1,187 @@
//
// MessageManager.swift
// Runner
//
// Created by z1u24 on 2021/6/29.
//
import Foundation
import OpenIMCore
public class MessageManager:NSObject{
private let KEY_ID: String = "id"
private let channel:FlutterMethodChannel
private let listeners: NSMutableDictionary = NSMutableDictionary(capacity: 0)
private var sendMsgProgressListener: SendMsgProgressListener?
init(channel:FlutterMethodChannel) {
self.channel = channel
}
func addAdvancedMsgListener(methodCall: FlutterMethodCall, result: FlutterResult){
if sendMsgProgressListener == nil {
sendMsgProgressListener = SendMsgProgressListener(channel: channel)
}
let d = methodCall.arguments as! NSDictionary
let key = d.value(forKey: KEY_ID) as! String
if !listeners.allKeys.contains(where: {($0 as! String).compare(key) == .orderedSame}) {
let lis = AdvancedMsgListenerImpl(channel: channel, id: key)
let k = methodCall.arguments as! NSDictionary
let s = k.value(forKey: KEY_ID) as! String
listeners.setValue(lis, forKey: s)
Open_im_sdkAddAdvancedMsgListener(lis)
print("=================add msg listener======\n\(lis)");
}
}
func removeAdvancedMsgListener(methodCall: FlutterMethodCall, result: FlutterResult){
let k = methodCall.arguments as! NSDictionary
let s = k.value(forKey: KEY_ID) as! String
if listeners.allKeys.contains(where: {($0 as! String).compare(s) == .orderedSame}) {
let lis = listeners.value(forKey: s) as! AdvancedMsgListenerImpl
listeners.removeObject(forKey: s)
Open_im_sdkRemoveAdvancedMsgListener(lis)
}
}
func sendMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
sendMsgProgressListener?.setCall(methodCall: methodCall)
sendMsgProgressListener?.setResult(result: result)
print("===============sendMessage===============")
Open_im_sdkSendMessage(sendMsgProgressListener, CommonUtil.getSendMessageContent(methodCall: methodCall), CommonUtil.getSendMessageReceiver(methodCall: methodCall), CommonUtil.getSendMessageGroupId(methodCall: methodCall), CommonUtil.getSendMessageOnlineOnly(methodCall: methodCall))
}
func getHistoryMessageList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkGetHistoryMessageList(BaseImpl(result: result), CommonUtil.getSDKJsonParam(methodCall: methodCall))
}
func revokeMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkRevokeMessage(BaseImpl(result: result), CommonUtil.getSDKJsonParam(methodCall: methodCall))
}
func deleteMessageFromLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkDeleteMessageFromLocalStorage(BaseImpl(result: result), CommonUtil.getSDKJsonParam(methodCall: methodCall))
}
func deleteMessages(methodCall: FlutterMethodCall, result: FlutterResult){
}
func insertSingleMessageToLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkInsertSingleMessageToLocalStorage(BaseImpl(result: result), CommonUtil.getSingleMessageContent(methodCall: methodCall), CommonUtil.getSingleMessageUserid(methodCall: methodCall), CommonUtil.getSingleMessageSender(methodCall: methodCall))
}
func findMessages(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkFindMessages(BaseImpl(result: result), CommonUtil.getFindMessageIds(methodCall: methodCall))
}
func markSingleMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkMarkSingleMessageHasRead(BaseImpl(result: result), CommonUtil.getSingleMessageUserid(methodCall: methodCall))
}
func createTextMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let prama = Open_im_sdkCreateTextMessage(CommonUtil.getMessageText(methodCall: methodCall))
DispatchQueue.main.async { result(prama) }
}
func createTextAtMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let prama = Open_im_sdkCreateTextAtMessage(CommonUtil.getMessageText(methodCall: methodCall), CommonUtil.getAtUserList(methodCall: methodCall))
DispatchQueue.main.async { result(prama) }
}
func createImageMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let prama = Open_im_sdkCreateImageMessage(CommonUtil.getImagePath(methodCall: methodCall))
DispatchQueue.main.async { result(prama) }
}
func createSoundMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let prama = Open_im_sdkCreateSoundMessage(CommonUtil.getSoundPath(methodCall: methodCall),CommonUtil.getSoundDuration(methodCall: methodCall))
DispatchQueue.main.async { result(prama) }
}
func createVideoMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let prama = Open_im_sdkCreateVideoMessage(CommonUtil.getVideoPath(methodCall: methodCall), CommonUtil.getVideoType(methodCall: methodCall), CommonUtil.getVideoDuration(methodCall: methodCall), CommonUtil.getVideoSnapshotPath(methodCall: methodCall))
DispatchQueue.main.async { result(prama) }
}
func createFileMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let prama = Open_im_sdkCreateFileMessage(CommonUtil.getFilePath(methodCall: methodCall), CommonUtil.getFileName(methodCall: methodCall))
DispatchQueue.main.async { result(prama) }
}
func createMergerMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let prama = Open_im_sdkCreateMergerMessage(CommonUtil.getMergerMessageList(methodCall: methodCall), CommonUtil.getMergerMessageTitle(methodCall: methodCall), CommonUtil.getSummaryList(methodCall: methodCall))
DispatchQueue.main.async { result(prama) }
}
func createForwardMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
let prama = Open_im_sdkCreateForwardMessage(CommonUtil.getForwardMessage(methodCall: methodCall))
DispatchQueue.main.async { result(prama) }
}
}
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: "messageProgressListener", 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 AdvancedMsgListenerImpl: 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)
}
}

View File

@@ -2,13 +2,205 @@ import Flutter
import UIKit
public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
let imManager: IMMananger
let conversationManager: ConversationManager
let friendshipManager: FriendshipManager
let messageManager: MessageManager
let groupManager: GroupManager
init(channel: FlutterMethodChannel) {
self.imManager = IMMananger(channel: channel)
self.conversationManager = ConversationManager(channel: channel)
self.friendshipManager = FriendshipManager(channel: channel)
self.messageManager = MessageManager(channel: channel)
self.groupManager = GroupManager(channel: channel)
}
public static func register(with registrar: FlutterPluginRegistrar) {
let channel = FlutterMethodChannel(name: "flutter_openim_sdk", binaryMessenger: registrar.messenger())
let instance = SwiftFlutterOpenimSdkPlugin()
let instance = SwiftFlutterOpenimSdkPlugin(channel: channel)
registrar.addMethodCallDelegate(instance, channel: channel)
}
public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) {
result("iOS " + UIDevice.current.systemVersion)
let managerName: String = CommonUtil.getParamValue(methodCall: call, param: "ManagerName") as! String
if managerName == "imManager" {
handleIMManager(call: call, result: result)
}else if managerName == "conversationManager"{
handleConversationManager(call: call, result: result)
}else if managerName == "friendshipManager"{
handleFriendshipManager(call: call, result: result)
}else if managerName == "messageManager"{
handleMessageManager(call: call, result: result)
}else if managerName == "groupManager"{
handleGroupManager(call: call, result: result)
}else{
print("Handle ManagerName Error: \(managerName) not found")
}
}
private func handleIMManager(call: FlutterMethodCall, result: @escaping FlutterResult){
let method: String = call.method
if method == "initSDK" {
imManager.initSDK(methodCall: call, result: result)
}else if method == "login" {
imManager.login(methodCall: call, result: result)
}else if method == "logout" {
imManager.logout(methodCall: call, result: result)
}else if method == "getLoginStatus" {
imManager.getLoginStatus(methodCall: call, result: result)
}else if method == "getLoginUid" {
imManager.getLoginUid(methodCall: call, result: result)
}else if method == "getUsersInfo" {
imManager.getUsersInfo(methodCall: call, result: result)
}else if method == "setSelfInfo" {
imManager.setSelfInfo(methodCall: call, result: result)
}else if method == "forceSyncLoginUerInfo" {
imManager.forceSyncLoginUerInfo(methodCall: call, result: result)
}else{
print("Handle MethodName Error: IMManager method: \(method) not found")
}
}
private func handleConversationManager(call: FlutterMethodCall, result: @escaping FlutterResult){
let method: String = call.method
if method == "setConversationListener" {
conversationManager.setConversationListener(methodCall: call, result: result)
}else if method == "getAllConversationList" {
conversationManager.getAllConversationList(methodCall: call, result: result)
}else if method == "getOneConversation" {
conversationManager.getOneConversation(methodCall: call, result: result)
}else if method == "getMultipleConversation" {
conversationManager.getMultipleConversation(methodCall: call, result: result)
}else if method == "deleteConversation" {
conversationManager.deleteConversation(methodCall: call, result: result)
}else if method == "setConversationDraft" {
conversationManager.setConversationDraft(methodCall: call, result: result)
}else if method == "pinConversation" {
conversationManager.pinConversation(methodCall: call, result: result)
}else if method == "getTotalUnreadMsgCount" {
conversationManager.getTotalUnreadMsgCount(methodCall: call, result: result)
}else{
print("Handle MethodName Error: ConversationManager method: \(method) not found")
}
}
private func handleFriendshipManager(call: FlutterMethodCall, result: @escaping FlutterResult){
let method: String = call.method
if method == "setFriendListener" {
friendshipManager.setFriendListener(methodCall: call, result: result)
}else if method == "getFriendsInfo" {
friendshipManager.getFriendsInfo(methodCall: call, result: result)
}else if method == "addFriend" {
friendshipManager.addFriend(methodCall: call, result: result)
}else if method == "getFriendApplicationList" {
friendshipManager.getFriendApplicationList(methodCall: call, result: result)
}else if method == "getFriendList" {
friendshipManager.getFriendList(methodCall: call, result: result)
}else if method == "setFriendInfo" {
friendshipManager.setFriendInfo(methodCall: call, result: result)
}else if method == "addToBlackList" {
friendshipManager.addToBlackList(methodCall: call, result: result)
}else if method == "getBlackList" {
friendshipManager.getBlackList(methodCall: call, result: result)
}else if method == "deleteFromBlackList" {
friendshipManager.deleteFromBlackList(methodCall: call, result: result)
}else if method == "checkFriend" {
friendshipManager.checkFriend(methodCall: call, result: result)
}else if method == "deleteFromFriendList" {
friendshipManager.deleteFromFriendList(methodCall: call, result: result)
}else if method == "acceptFriendApplication" {
friendshipManager.acceptFriendApplication(methodCall: call, result: result)
}else if method == "refuseFriendApplication" {
friendshipManager.refuseFriendApplication(methodCall: call, result: result)
}else if method == "forceSyncFriendApplication" {
friendshipManager.forceSyncFriendApplication(methodCall: call, result: result)
}else if method == "forceSyncFriend" {
friendshipManager.forceSyncFriend(methodCall: call, result: result)
}else if method == "forceSyncBlackList" {
friendshipManager.forceSyncBlackList(methodCall: call, result: result)
}else{
print("Handle MethodName Error: FriendshipManager method: \(method) not found")
}
}
private func handleMessageManager(call: FlutterMethodCall, result: @escaping FlutterResult){
let method: String = call.method
if method == "addAdvancedMsgListener" {
messageManager.addAdvancedMsgListener(methodCall: call, result: result)
}else if method == "removeAdvancedMsgListener" {
messageManager.removeAdvancedMsgListener(methodCall: call, result: result)
}else if method == "sendMessage" {
messageManager.sendMessage(methodCall: call, result: result)
}else if method == "getHistoryMessageList" {
messageManager.getHistoryMessageList(methodCall: call, result: result)
}else if method == "revokeMessage" {
messageManager.revokeMessage(methodCall: call, result: result)
}else if method == "deleteMessageFromLocalStorage" {
messageManager.deleteMessageFromLocalStorage(methodCall: call, result: result)
}else if method == "deleteMessages" {
messageManager.deleteMessages(methodCall: call, result: result)
}else if method == "insertSingleMessageToLocalStorage" {
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 == "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 == "createSoundMessage" {
messageManager.createSoundMessage(methodCall: call, result: result)
}else if method == "createVideoMessage" {
messageManager.createVideoMessage(methodCall: call, result: result)
}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{
print("Handle MethodName Error: MessageManager method: \(method) not found")
}
}
private func handleGroupManager(call: FlutterMethodCall, result: @escaping FlutterResult){
let method: String = call.method
if method == "inviteUserToGroup" {
groupManager.inviteUserToGroup(methodCall: call, result: result)
}else if method == "kickGroupMember" {
groupManager.kickGroupMember(methodCall: call, result: result)
}else if method == "getGroupMembersInfo" {
groupManager.getGroupMembersInfo(methodCall: call, result: result)
}else if method == "getGroupMemberList" {
groupManager.getGroupMemberList(methodCall: call, result: result)
}else if method == "getJoinedGroupList" {
groupManager.getJoinedGroupList(methodCall: call, result: result)
}else if method == "createGroup" {
groupManager.createGroup(methodCall: call, result: result)
}else if method == "setGroupInfo" {
groupManager.setGroupInfo(methodCall: call, result: result)
}else if method == "getGroupsInfo" {
groupManager.getGroupsInfo(methodCall: call, result: result)
}else if method == "joinGroup" {
groupManager.joinGroup(methodCall: call, result: result)
}else if method == "quitGroup" {
groupManager.quitGroup(methodCall: call, result: result)
}else if method == "transferGroupOwner" {
groupManager.transferGroupOwner(methodCall: call, result: result)
}else if method == "getGroupApplicationList" {
groupManager.getGroupApplicationList(methodCall: call, result: result)
}else if method == "acceptGroupApplication" {
groupManager.acceptGroupApplication(methodCall: call, result: result)
}else if method == "refuseGroupApplication" {
groupManager.refuseGroupApplication(methodCall: call, result: result)
}else{
print("Handle MethodName Error: MessageManager method: \(method) not found")
}
}
}