diff --git a/android/build.gradle b/android/build.gradle index 8061ad2..e60001d 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -41,5 +41,5 @@ android { } } dependencies { - implementation 'io.openim:client-sdk:1.4.5@aar' + implementation 'io.openim:client-sdk:1.5.4@aar' } \ No newline at end of file diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/FlutterOpenimSdkPlugin.java b/android/src/main/java/io/openim/flutter_openim_sdk/FlutterOpenimSdkPlugin.java index 7e7b30f..c7f7766 100644 --- a/android/src/main/java/io/openim/flutter_openim_sdk/FlutterOpenimSdkPlugin.java +++ b/android/src/main/java/io/openim/flutter_openim_sdk/FlutterOpenimSdkPlugin.java @@ -18,6 +18,7 @@ import io.openim.flutter_openim_sdk.manager.FriendshipManager; import io.openim.flutter_openim_sdk.manager.GroupManager; import io.openim.flutter_openim_sdk.manager.IMManager; import io.openim.flutter_openim_sdk.manager.MessageManager; +import io.openim.flutter_openim_sdk.manager.UserManager; /** @@ -31,6 +32,7 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler public static MethodChannel channel; private static IMManager imManager; + private static UserManager userManager; private static FriendshipManager friendshipManager; private static MessageManager messageManager; private static ConversationManager conversationManager; @@ -41,6 +43,7 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler private FlutterOpenimSdkPlugin(Context context) { FlutterOpenimSdkPlugin.imManager = new IMManager(); + FlutterOpenimSdkPlugin.userManager = new UserManager(); FlutterOpenimSdkPlugin.friendshipManager = new FriendshipManager(); FlutterOpenimSdkPlugin.messageManager = new MessageManager(); FlutterOpenimSdkPlugin.conversationManager = new ConversationManager(); diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/listener/FriendshipListener.java b/android/src/main/java/io/openim/flutter_openim_sdk/listener/FriendshipListener.java deleted file mode 100644 index 7ec7962..0000000 --- a/android/src/main/java/io/openim/flutter_openim_sdk/listener/FriendshipListener.java +++ /dev/null @@ -1,52 +0,0 @@ -package io.openim.flutter_openim_sdk.listener; - -import io.openim.flutter_openim_sdk.util.CommonUtil; -import open_im_sdk.OnFriendshipListener; - -public class FriendshipListener implements OnFriendshipListener { - - @Override - public void onBlackListAdd(String s) { - CommonUtil.emitEvent("friendListener", "onBlackListAdd", s); - } - - @Override - public void onBlackListDeleted(String s) { - CommonUtil.emitEvent("friendListener", "onBlackListDeleted", s); - } - - @Override - public void onFriendApplicationListAccept(String s) { - CommonUtil.emitEvent("friendListener", "onFriendApplicationListAccept", s); - } - - @Override - public void onFriendApplicationListAdded(String s) { - CommonUtil.emitEvent("friendListener", "onFriendApplicationListAdded", s); - } - - @Override - public void onFriendApplicationListDeleted(String s) { - CommonUtil.emitEvent("friendListener", "onFriendApplicationListDeleted", s); - } - - @Override - public void onFriendApplicationListReject(String s) { - CommonUtil.emitEvent("friendListener", "onFriendApplicationListReject", s); - } - - @Override - public void onFriendInfoChanged(String s) { - CommonUtil.emitEvent("friendListener", "onFriendInfoChanged", s); - } - - @Override - public void onFriendListAdded(String s) { - CommonUtil.emitEvent("friendListener", "onFriendListAdded", s); - } - - @Override - public void onFriendListDeleted(String s) { - CommonUtil.emitEvent("friendListener", "onFriendListDeleted", s); - } -} diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/listener/GroupListener.java b/android/src/main/java/io/openim/flutter_openim_sdk/listener/GroupListener.java deleted file mode 100644 index 7c6b418..0000000 --- a/android/src/main/java/io/openim/flutter_openim_sdk/listener/GroupListener.java +++ /dev/null @@ -1,79 +0,0 @@ -package io.openim.flutter_openim_sdk.listener; - -import android.util.ArrayMap; - -import java.util.HashMap; -import java.util.Map; - -import io.openim.flutter_openim_sdk.util.CommonUtil; -import open_im_sdk.OnGroupListener; - -public class GroupListener implements OnGroupListener { - @Override - public void onApplicationProcessed(String s, String s1, int i, String s2) { - Map map = new ArrayMap<>(); - map.put("groupId", s); - map.put("opUser", s1); - map.put("agreeOrReject", i); - map.put("opReason", s2); - CommonUtil.emitEvent("groupListener", "onApplicationProcessed", map); - } - - @Override - public void onGroupCreated(String s) { - Map map = new ArrayMap<>(); - map.put("groupId", s); - CommonUtil.emitEvent("groupListener", "onGroupCreated", map); - } - - @Override - public void onGroupInfoChanged(String s, String s1) { - Map map = new ArrayMap<>(); - map.put("groupId", s); - map.put("groupInfo", s1); - CommonUtil.emitEvent("groupListener", "onGroupInfoChanged", map); - } - - @Override - public void onMemberEnter(String s, String s1) { - Map map = new ArrayMap<>(); - map.put("groupId", s); - map.put("memberList", s1); - CommonUtil.emitEvent("groupListener", "onMemberEnter", map); - } - - @Override - public void onMemberInvited(String s, String s1, String s2) { - Map map = new ArrayMap<>(); - map.put("groupId", s); - map.put("opUser", s1); - map.put("memberList", s2); - CommonUtil.emitEvent("groupListener", "onMemberInvited", map); - } - - @Override - public void onMemberKicked(String s, String s1, String s2) { - Map map = new ArrayMap<>(); - map.put("groupId", s); - map.put("opUser", s1); - map.put("memberList", s2); - CommonUtil.emitEvent("groupListener", "onMemberKicked", map); - } - - @Override - public void onMemberLeave(String s, String s1) { - Map map = new ArrayMap<>(); - map.put("groupId", s); - map.put("member", s1); - CommonUtil.emitEvent("groupListener", "onMemberLeave", map); - } - - @Override - public void onReceiveJoinApplication(String s, String s1, String s2) { - Map map = new ArrayMap<>(); - map.put("groupId", s); - map.put("member", s1); - map.put("opReason", s2); - CommonUtil.emitEvent("groupListener", "onReceiveJoinApplication", map); - } -} diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/listener/AdvancedMsgListener.java b/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnAdvancedMsgListener.java similarity index 87% rename from android/src/main/java/io/openim/flutter_openim_sdk/listener/AdvancedMsgListener.java rename to android/src/main/java/io/openim/flutter_openim_sdk/listener/OnAdvancedMsgListener.java index ab16ed7..a890a83 100644 --- a/android/src/main/java/io/openim/flutter_openim_sdk/listener/AdvancedMsgListener.java +++ b/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnAdvancedMsgListener.java @@ -5,13 +5,12 @@ import android.util.ArrayMap; import java.util.Map; import io.openim.flutter_openim_sdk.util.CommonUtil; -import open_im_sdk.OnAdvancedMsgListener; -public class AdvancedMsgListener implements OnAdvancedMsgListener { +public class OnAdvancedMsgListener implements open_im_sdk_callback.OnAdvancedMsgListener { // final Map values = new HashMap<>(); private final String id; - public AdvancedMsgListener(String listenerId) { + public OnAdvancedMsgListener(String listenerId) { this.id = listenerId; // this.values.put("id", listenerId); } diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/listener/BaseListener.java b/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnBaseListener.java similarity index 59% rename from android/src/main/java/io/openim/flutter_openim_sdk/listener/BaseListener.java rename to android/src/main/java/io/openim/flutter_openim_sdk/listener/OnBaseListener.java index 10f4328..7ab282b 100644 --- a/android/src/main/java/io/openim/flutter_openim_sdk/listener/BaseListener.java +++ b/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnBaseListener.java @@ -1,28 +1,25 @@ package io.openim.flutter_openim_sdk.listener; -import io.flutter.Log; import io.flutter.plugin.common.MethodChannel; import io.openim.flutter_openim_sdk.util.CommonUtil; -import open_im_sdk.Base; +import open_im_sdk_callback.Base; -public class BaseListener implements Base { +public class OnBaseListener implements Base { MethodChannel.Result result; - public BaseListener(MethodChannel.Result result) { + public OnBaseListener(MethodChannel.Result result) { this.result = result; } @Override - public void onError(long l, String s) { -// Log.e("F-OpenIMSD(callback)", s); + public void onError(int l, String s) { CommonUtil.runMainThreadReturnError(result, l, s, null); } @Override public void onSuccess(String s) { -// Log.i("F-OpenIMSDK(callback)", s); CommonUtil.runMainThreadReturn(result, s); } } diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnConnListener.java b/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnConnListener.java new file mode 100644 index 0000000..e21c7d5 --- /dev/null +++ b/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnConnListener.java @@ -0,0 +1,34 @@ +package io.openim.flutter_openim_sdk.listener; + + +import io.openim.flutter_openim_sdk.util.CommonUtil; + + +public class OnConnListener implements open_im_sdk_callback.OnConnListener { + + @Override + public void onConnectFailed(int i, String s) { + CommonUtil.emitEvent("connectListener", "onConnectFailed", i, s, null); + } + + @Override + public void onConnectSuccess() { + CommonUtil.emitEvent("connectListener", "onConnectSuccess", null); + } + + @Override + public void onConnecting() { + CommonUtil.emitEvent("connectListener", "onConnecting", null); + } + + @Override + public void onKickedOffline() { + CommonUtil.emitEvent("connectListener", "onKickedOffline", null); + } + + + @Override + public void onUserTokenExpired() { + CommonUtil.emitEvent("connectListener", "onUserTokenExpired", null); + } +} diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/listener/ConversationListener.java b/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnConversationListener.java similarity index 89% rename from android/src/main/java/io/openim/flutter_openim_sdk/listener/ConversationListener.java rename to android/src/main/java/io/openim/flutter_openim_sdk/listener/OnConversationListener.java index 9d91ea1..0425637 100644 --- a/android/src/main/java/io/openim/flutter_openim_sdk/listener/ConversationListener.java +++ b/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnConversationListener.java @@ -1,10 +1,9 @@ package io.openim.flutter_openim_sdk.listener; import io.openim.flutter_openim_sdk.util.CommonUtil; -import open_im_sdk.OnConversationListener; -public class ConversationListener implements OnConversationListener { +public class OnConversationListener implements open_im_sdk_callback.OnConversationListener { @Override public void onConversationChanged(String s) { diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnFriendshipListener.java b/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnFriendshipListener.java new file mode 100644 index 0000000..a8d8468 --- /dev/null +++ b/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnFriendshipListener.java @@ -0,0 +1,76 @@ +package io.openim.flutter_openim_sdk.listener; + +import io.openim.flutter_openim_sdk.util.CommonUtil; + +/** + * 申请添加好友: + * 主动申请者收到OnFriendApplicationAdded + * 被添加者收到OnFriendApplicationAdded ok 111加222 + *

+ * 同意好友申请: + * 操作者收到 OnFriendApplicationAccepted OnFriendAdded; + * 申请者收到:OnFriendApplicationAccepted OnFriendAdded ok + *

+ * 好友拒绝申请: + * 操作者收到OnFriendApplicationRejected; + * 申请者收到:OnFriendApplicationRejected ok + *

+ * 删除好友: + * 操作者收到OnFriendDeleted ok + *

+ * 修改备注: + * 操作者收到OnFriendInfoChanged ok + *

+ * 添加黑名单: + * 操作者收到OnBlackAdded; ok + *

+ * 移除黑名单: + * 操作者收到OnBlackDeleted ok + */ +public class OnFriendshipListener implements open_im_sdk_callback.OnFriendshipListener { + + @Override + public void onBlackAdded(String s) { + CommonUtil.emitEvent("friendListener", "onBlacklistAdded", s); + } + + @Override + public void onBlackDeleted(String s) { + CommonUtil.emitEvent("friendListener", "onBlacklistDeleted", s); + } + + @Override + public void onFriendAdded(String s) { + CommonUtil.emitEvent("friendListener", "onFriendAdded", s); + } + + @Override + public void onFriendApplicationAccepted(String s) { + CommonUtil.emitEvent("friendListener", "onFriendApplicationAccepted", s); + } + + @Override + public void onFriendApplicationAdded(String s) { + CommonUtil.emitEvent("friendListener", "onFriendApplicationAdded", s); + } + + @Override + public void onFriendApplicationDeleted(String s) { + CommonUtil.emitEvent("friendListener", "onFriendApplicationDeleted", s); + } + + @Override + public void onFriendApplicationRejected(String s) { + CommonUtil.emitEvent("friendListener", "onFriendApplicationRejected", s); + } + + @Override + public void onFriendDeleted(String s) { + CommonUtil.emitEvent("friendListener", "onFriendDeleted", s); + } + + @Override + public void onFriendInfoChanged(String s) { + CommonUtil.emitEvent("friendListener", "onFriendInfoChanged", s); + } +} diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnGroupListener.java b/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnGroupListener.java new file mode 100644 index 0000000..4ade91f --- /dev/null +++ b/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnGroupListener.java @@ -0,0 +1,97 @@ +package io.openim.flutter_openim_sdk.listener; + +import io.openim.flutter_openim_sdk.util.CommonUtil; + +/** + * 创建群: + * 初始成员收到:OnJoinedGroupAdded 验证ok 1111 创建 2222 + *

+ * 退出群: + * 退出者收到:OnJoinedGroupDeleted + * 群成员收到:OnGroupMemberDeleted 2222退出群 验证ok + *

+ * 踢出群: + * 被踢者收到:OnJoinedGroupDeleted + * 群成员收到:OnGroupMemberDeleted 验证ok + *

+ * 邀请进群: + * 被邀请者收到:OnJoinedGroupAdded + * 群成员(不包括被邀请者)收到:OnGroupMemberAdded 1111邀请2222 验证ok + *

+ * 申请加群: + * 申请者收到:OnGroupApplicationAdded + * 群主+管理员收到:OnReceiveJoinGroupApplicationAdded 验证ok + *

+ * 同意进群: + * 申请者收到:OnJoinedGroupAdded OnGroupApplicationAccepted + * 群成员(不包括申请者)收到:OnGroupMemberAdded + * 审批者(群主或者管理员)收到:OnGroupMemberAdded OnGroupApplicationAccepted 验证ok + *

+ * 拒绝进群: + * 申请者收到:OnGroupApplicationRejected; + * 审批者(群主或者管理员)收到:OnGroupApplicationRejected 验证ok + *

+ * 修改群资料: 群成员收到: OnGroupInfoChanged 验证ok + */ +public class OnGroupListener implements open_im_sdk_callback.OnGroupListener { + + @Override + public void onGroupApplicationAccepted(String s) { + CommonUtil.emitEvent("groupListener", "onGroupApplicationAccepted", s); + } + + @Override + public void onGroupApplicationAdded(String s) { + CommonUtil.emitEvent("groupListener", "onGroupApplicationAdded", s); + } + + @Override + public void onGroupApplicationDeleted(String s) { + CommonUtil.emitEvent("groupListener", "onGroupApplicationDeleted", s); + } + + @Override + public void onGroupApplicationRejected(String s) { + CommonUtil.emitEvent("groupListener", "onGroupApplicationRejected", s); + } + + @Override + public void onGroupInfoChanged(String s) { + CommonUtil.emitEvent("groupListener", "onGroupInfoChanged", s); + } + + @Override + public void onGroupMemberAdded(String s) { + CommonUtil.emitEvent("groupListener", "onGroupMemberAdded", s); + } + + @Override + public void onGroupMemberDeleted(String s) { + CommonUtil.emitEvent("groupListener", "onGroupMemberDeleted", s); + } + + @Override + public void onGroupMemberInfoChanged(String s) { + CommonUtil.emitEvent("groupListener", "onGroupMemberInfoChanged", s); + } + + @Override + public void onJoinedGroupAdded(String s) { + CommonUtil.emitEvent("groupListener", "onJoinedGroupAdded", s); + } + + @Override + public void onJoinedGroupDeleted(String s) { + CommonUtil.emitEvent("groupListener", "onJoinedGroupDeleted", s); + } + + @Override + public void onReceiveJoinGroupApplicationAdded(String s) { + CommonUtil.emitEvent("groupListener", "onReceiveJoinGroupApplicationAdded", s); + } + + @Override + public void onReceiveJoinGroupApplicationDeleted(String s) { + CommonUtil.emitEvent("groupListener", "onReceiveJoinGroupApplicationDeleted", s); + } +} diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/listener/MsgSendProgressListener.java b/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnMsgSendListener.java similarity index 81% rename from android/src/main/java/io/openim/flutter_openim_sdk/listener/MsgSendProgressListener.java rename to android/src/main/java/io/openim/flutter_openim_sdk/listener/OnMsgSendListener.java index c873b82..4b57e0b 100644 --- a/android/src/main/java/io/openim/flutter_openim_sdk/listener/MsgSendProgressListener.java +++ b/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnMsgSendListener.java @@ -7,14 +7,14 @@ import java.util.Map; import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; import io.openim.flutter_openim_sdk.util.CommonUtil; -import open_im_sdk.SendMsgCallBack; +import open_im_sdk_callback.SendMsgCallBack; -public class MsgSendProgressListener implements SendMsgCallBack { +public class OnMsgSendListener implements SendMsgCallBack { final private MethodChannel.Result result; // final private MethodCall call; final private Object clientMsgID; - public MsgSendProgressListener(MethodChannel.Result result, MethodCall call) { + public OnMsgSendListener(MethodChannel.Result result, MethodCall call) { this.result = result; // this.call = call; Map args = call.argument("message"); @@ -22,7 +22,7 @@ public class MsgSendProgressListener implements SendMsgCallBack { } @Override - public void onError(long l, String s) { + public void onError(int l, String s) { CommonUtil.runMainThreadReturnError(result, l, s, null); } diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnUserListener.java b/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnUserListener.java new file mode 100644 index 0000000..5d48819 --- /dev/null +++ b/android/src/main/java/io/openim/flutter_openim_sdk/listener/OnUserListener.java @@ -0,0 +1,14 @@ +package io.openim.flutter_openim_sdk.listener; + +import io.openim.flutter_openim_sdk.util.CommonUtil; + +public class OnUserListener implements open_im_sdk_callback.OnUserListener { + + /** + * 登录用户个人资料有变化时回调 + */ + @Override + public void onSelfInfoUpdated(String s) { + CommonUtil.emitEvent("userListener", "onSelfInfoUpdated", s); + } +} diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/listener/SDKListener.java b/android/src/main/java/io/openim/flutter_openim_sdk/listener/SDKListener.java deleted file mode 100644 index cb7cf03..0000000 --- a/android/src/main/java/io/openim/flutter_openim_sdk/listener/SDKListener.java +++ /dev/null @@ -1,38 +0,0 @@ -package io.openim.flutter_openim_sdk.listener; - - -import io.openim.flutter_openim_sdk.util.CommonUtil; -import open_im_sdk.IMSDKListener; - -public class SDKListener implements IMSDKListener { - - @Override - public void onConnectFailed(long l, String s) { - CommonUtil.emitEvent("initSDKListener", "onConnectFailed", l, s, null); - } - - @Override - public void onConnectSuccess() { - CommonUtil.emitEvent("initSDKListener", "onConnectSuccess", null); - } - - @Override - public void onConnecting() { - CommonUtil.emitEvent("initSDKListener", "onConnecting", null); - } - - @Override - public void onKickedOffline() { - CommonUtil.emitEvent("initSDKListener", "onKickedOffline", null); - } - - @Override - public void onSelfInfoUpdated(String s) { - CommonUtil.emitEvent("initSDKListener", "onSelfInfoUpdated", s); - } - - @Override - public void onUserTokenExpired() { - CommonUtil.emitEvent("initSDKListener", "onUserTokenExpired", null); - } -} diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/manager/ConversationManager.java b/android/src/main/java/io/openim/flutter_openim_sdk/manager/ConversationManager.java index cb0ab11..7f70c9e 100644 --- a/android/src/main/java/io/openim/flutter_openim_sdk/manager/ConversationManager.java +++ b/android/src/main/java/io/openim/flutter_openim_sdk/manager/ConversationManager.java @@ -2,74 +2,98 @@ package io.openim.flutter_openim_sdk.manager; import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; -import io.openim.flutter_openim_sdk.listener.BaseListener; -import io.openim.flutter_openim_sdk.listener.ConversationListener; +import io.openim.flutter_openim_sdk.listener.OnBaseListener; +import io.openim.flutter_openim_sdk.listener.OnConversationListener; import io.openim.flutter_openim_sdk.util.CommonUtil; import open_im_sdk.Open_im_sdk; public class ConversationManager extends BaseManager { public void setConversationListener(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.setConversationListener(new ConversationListener()); + Open_im_sdk.setConversationListener(new OnConversationListener()); } + public void getAllConversationList(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.getAllConversationList(new BaseListener(result)); + Open_im_sdk.getAllConversationList( + new OnBaseListener(result), + value(methodCall, "operationID") + ); } public void getConversationListSplit(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.getConversationListSplit(new BaseListener(result), + Open_im_sdk.getConversationListSplit( + new OnBaseListener(result), + value(methodCall, "operationID"), int2long(methodCall, "offset"), - int2long(methodCall, "count")); + int2long(methodCall, "count") + ); } public void getOneConversation(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.getOneConversation( - value(methodCall, "sourceID"), + new OnBaseListener(result), + value(methodCall, "operationID"), int2long(methodCall, "sessionType"), - new BaseListener(result)); + value(methodCall, "sourceID") + ); } public void getMultipleConversation(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.getMultipleConversation( - jsonValue(methodCall, "conversationIDList"), - new BaseListener(result)); + new OnBaseListener(result), + value(methodCall, "operationID"), + jsonValue(methodCall, "conversationIDList") + ); } public void deleteConversation(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.deleteConversation( - value(methodCall, "conversationID"), - new BaseListener(result)); + new OnBaseListener(result), + value(methodCall, "operationID"), + value(methodCall, "conversationID") + ); } public void setConversationDraft(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.setConversationDraft( + new OnBaseListener(result), + value(methodCall, "operationID"), value(methodCall, "conversationID"), - value(methodCall, "draftText"), - new BaseListener(result)); + value(methodCall, "draftText") + ); } public void pinConversation(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.pinConversation( + new OnBaseListener(result), + value(methodCall, "operationID"), value(methodCall, "conversationID"), - value(methodCall, "isPinned"), - new BaseListener(result)); + value(methodCall, "isPinned") + ); } - public void markSingleMessageHasRead(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.markSingleMessageHasRead( - new BaseListener(result), - value(methodCall, "userID")); - } +// public void markSingleMessageHasRead(MethodCall methodCall, MethodChannel.Result result) { +// Open_im_sdk.markSingleMessageHasRead( +// new OnBaseListener(result), +// value(methodCall, "operationID"), +// value(methodCall, "userID") +// ); +// } public void markGroupMessageHasRead(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.markGroupMessageHasRead( - new BaseListener(result), - value(methodCall, "groupID")); + new OnBaseListener(result), + value(methodCall, "operationID"), + value(methodCall, "groupID") + ); } public void getTotalUnreadMsgCount(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.getTotalUnreadMsgCount(new BaseListener(result)); + Open_im_sdk.getTotalUnreadMsgCount( + new OnBaseListener(result), + value(methodCall, "operationID") + ); } public void getConversationIDBySessionType(MethodCall methodCall, MethodChannel.Result result) { @@ -80,7 +104,8 @@ public class ConversationManager extends BaseManager { public void setConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.setConversationRecvMessageOpt( - new BaseListener(result), + new OnBaseListener(result), + value(methodCall, "operationID"), jsonValue(methodCall, "conversationIDList"), int2long(methodCall, "status") ); @@ -88,7 +113,8 @@ public class ConversationManager extends BaseManager { public void getConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.getConversationRecvMessageOpt( - new BaseListener(result), + new OnBaseListener(result), + value(methodCall, "operationID"), jsonValue(methodCall, "conversationIDList") ); } diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/manager/FriendshipManager.java b/android/src/main/java/io/openim/flutter_openim_sdk/manager/FriendshipManager.java index c0ff9cc..ecdef0b 100644 --- a/android/src/main/java/io/openim/flutter_openim_sdk/manager/FriendshipManager.java +++ b/android/src/main/java/io/openim/flutter_openim_sdk/manager/FriendshipManager.java @@ -2,72 +2,115 @@ package io.openim.flutter_openim_sdk.manager; import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; -import io.openim.flutter_openim_sdk.listener.BaseListener; -import io.openim.flutter_openim_sdk.listener.FriendshipListener; +import io.openim.flutter_openim_sdk.listener.OnBaseListener; +import io.openim.flutter_openim_sdk.listener.OnFriendshipListener; import open_im_sdk.Open_im_sdk; public class FriendshipManager extends BaseManager { public void setFriendListener(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.setFriendListener(new FriendshipListener()); + Open_im_sdk.setFriendListener(new OnFriendshipListener()); } public void getFriendsInfo(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.getFriendsInfo(new BaseListener(result), - jsonValue(methodCall, "uidList")); + Open_im_sdk.getDesignatedFriendsInfo( + new OnBaseListener(result), + value(methodCall, "operationID"), + jsonValue(methodCall, "uidList") + ); } public void addFriend(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.addFriend(new BaseListener(result), - jsonValue(methodCall)); + Open_im_sdk.addFriend( + new OnBaseListener(result), + value(methodCall, "operationID"), + jsonValue(methodCall) + ); } - public void getFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.getFriendApplicationList(new BaseListener(result)); + public void getRecvFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) { + Open_im_sdk.getRecvFriendApplicationList( + new OnBaseListener(result), + value(methodCall, "operationID") + ); + } + + public void getSendFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) { + Open_im_sdk.getSendFriendApplicationList( + new OnBaseListener(result), + value(methodCall, "operationID") + ); } public void getFriendList(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.getFriendList(new BaseListener(result)); + Open_im_sdk.getFriendList( + new OnBaseListener(result), + value(methodCall, "operationID") + ); } - public void setFriendInfo(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.setFriendInfo( - jsonValue(methodCall), new BaseListener(result)); + public void setFriendRemark(MethodCall methodCall, MethodChannel.Result result) { + Open_im_sdk.setFriendRemark( + new OnBaseListener(result), + value(methodCall, "operationID"), + jsonValue(methodCall) + ); } - public void addToBlackList(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.addToBlackList(new BaseListener(result), - jsonValue(methodCall, "uid")); + public void addBlacklist(MethodCall methodCall, MethodChannel.Result result) { + Open_im_sdk.addBlack( + new OnBaseListener(result), + value(methodCall, "operationID"), + value(methodCall, "uid") + ); } - public void getBlackList(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.getBlackList(new BaseListener(result)); + public void getBlacklist(MethodCall methodCall, MethodChannel.Result result) { + Open_im_sdk.getBlackList( + new OnBaseListener(result), + value(methodCall, "operationID") + ); } - public void deleteFromBlackList(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.deleteFromBlackList(new BaseListener(result), - jsonValue(methodCall, "uid")); + public void removeBlacklist(MethodCall methodCall, MethodChannel.Result result) { + Open_im_sdk.removeBlack( + new OnBaseListener(result), + value(methodCall, "operationID"), + value(methodCall, "uid") + ); } public void checkFriend(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.checkFriend(new BaseListener(result), - jsonValue(methodCall, "uidList")); + Open_im_sdk.checkFriend( + new OnBaseListener(result), + value(methodCall, "operationID"), + jsonValue(methodCall, "uidList") + ); } - public void deleteFromFriendList(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.deleteFromFriendList( - jsonValue(methodCall, "uid"), new BaseListener(result)); + public void deleteFriend(MethodCall methodCall, MethodChannel.Result result) { + Open_im_sdk.deleteFriend( + new OnBaseListener(result), + value(methodCall, "operationID"), + value(methodCall, "uid") + ); } public void acceptFriendApplication(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.acceptFriendApplication(new BaseListener(result), - jsonValue(methodCall, "uid")); + Open_im_sdk.acceptFriendApplication( + new OnBaseListener(result), + value(methodCall, "operationID"), + jsonValue(methodCall) + ); } public void refuseFriendApplication(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.refuseFriendApplication(new BaseListener(result), - jsonValue(methodCall, "uid")); + Open_im_sdk.refuseFriendApplication( + new OnBaseListener(result), + value(methodCall, "operationID"), + jsonValue(methodCall) + ); } // public void forceSyncFriendApplication(MethodCall methodCall, MethodChannel.Result result) { diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/manager/GroupManager.java b/android/src/main/java/io/openim/flutter_openim_sdk/manager/GroupManager.java index f24952a..64e2e9b 100644 --- a/android/src/main/java/io/openim/flutter_openim_sdk/manager/GroupManager.java +++ b/android/src/main/java/io/openim/flutter_openim_sdk/manager/GroupManager.java @@ -2,104 +2,149 @@ package io.openim.flutter_openim_sdk.manager; import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; -import io.openim.flutter_openim_sdk.listener.BaseListener; -import io.openim.flutter_openim_sdk.listener.GroupListener; +import io.openim.flutter_openim_sdk.listener.OnBaseListener; +import io.openim.flutter_openim_sdk.listener.OnGroupListener; import open_im_sdk.Open_im_sdk; public class GroupManager extends BaseManager { public void setGroupListener(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.setGroupListener(new GroupListener()); + Open_im_sdk.setGroupListener(new OnGroupListener()); } public void inviteUserToGroup(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.inviteUserToGroup( + new OnBaseListener(result), + value(methodCall, "operationID"), value(methodCall, "gid"), value(methodCall, "reason"), - jsonValue(methodCall, "uidList"), - new BaseListener(result)); + jsonValue(methodCall, "uidList") + ); } public void kickGroupMember(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.kickGroupMember( + new OnBaseListener(result), + value(methodCall, "operationID"), value(methodCall, "gid"), value(methodCall, "reason"), - jsonValue(methodCall, "uidList"), - new BaseListener(result)); + jsonValue(methodCall, "uidList") + ); } public void getGroupMembersInfo(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.getGroupMembersInfo( + new OnBaseListener(result), + value(methodCall, "operationID"), value(methodCall, "gid"), - jsonValue(methodCall, "uidList"), - new BaseListener(result)); + jsonValue(methodCall, "uidList") + ); } public void getGroupMemberList(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.getGroupMemberList( + new OnBaseListener(result), + value(methodCall, "operationID"), value(methodCall, "gid"), value(methodCall, "filter"), - value(methodCall, "next"), - new BaseListener(result)); + value(methodCall, "offset"), + value(methodCall, "count") + ); } public void getJoinedGroupList(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.getJoinedGroupList(new BaseListener(result)); + Open_im_sdk.getJoinedGroupList( + new OnBaseListener(result), + value(methodCall, "operationID") + ); } public void createGroup(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.createGroup( + new OnBaseListener(result), + value(methodCall, "operationID"), jsonValue(methodCall, "gInfo"), - jsonValue(methodCall, "memberList"), - new BaseListener(result)); + jsonValue(methodCall, "memberList") + ); } public void setGroupInfo(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.setGroupInfo(jsonValue(methodCall, "gInfo"), new BaseListener(result)); + Open_im_sdk.setGroupInfo( + new OnBaseListener(result), + value(methodCall, "operationID"), + value(methodCall, "gid"), + jsonValue(methodCall, "gInfo") + ); } public void getGroupsInfo(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.getGroupsInfo(jsonValue(methodCall, "gidList"), new BaseListener(result)); + Open_im_sdk.getGroupsInfo( + new OnBaseListener(result), + value(methodCall, "operationID"), + jsonValue(methodCall, "gidList") + ); } public void joinGroup(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.joinGroup( + new OnBaseListener(result), + value(methodCall, "operationID"), value(methodCall, "gid"), - value(methodCall, "reason"), - new BaseListener(result)); + value(methodCall, "reason") + ); } public void quitGroup(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.quitGroup( - value(methodCall, "gid"), - new BaseListener(result)); + new OnBaseListener(result), + value(methodCall, "operationID"), + value(methodCall, "gid") + ); } public void transferGroupOwner(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.transferGroupOwner( + new OnBaseListener(result), + value(methodCall, "operationID"), value(methodCall, "gid"), - value(methodCall, "uid"), - new BaseListener(result)); + value(methodCall, "uid") + ); + } + + public void getRecvGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) { + Open_im_sdk.getRecvGroupApplicationList( + new OnBaseListener(result), + value(methodCall, "operationID") + ); } - public void getGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.getGroupApplicationList(new BaseListener(result)); + public void getSendGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) { + Open_im_sdk.getSendGroupApplicationList( + new OnBaseListener(result), + value(methodCall, "operationID") + ); } public void acceptGroupApplication(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.acceptGroupApplication( - jsonValue(methodCall, "application"), - value(methodCall, "reason"), - new BaseListener(result)); + new OnBaseListener(result), + value(methodCall, "operationID"), + value(methodCall, "gid"), + value(methodCall, "uid"), + value(methodCall, "handleMsg") + ); } public void refuseGroupApplication(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.refuseGroupApplication( - jsonValue(methodCall, "application"), - value(methodCall, "reason"), - new BaseListener(result)); + new OnBaseListener(result), + value(methodCall, "operationID"), + value(methodCall, "gid"), + value(methodCall, "uid"), + value(methodCall, "handleMsg") + ); } diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/manager/IMManager.java b/android/src/main/java/io/openim/flutter_openim_sdk/manager/IMManager.java index ccb41bf..c6a28b0 100644 --- a/android/src/main/java/io/openim/flutter_openim_sdk/manager/IMManager.java +++ b/android/src/main/java/io/openim/flutter_openim_sdk/manager/IMManager.java @@ -2,8 +2,8 @@ package io.openim.flutter_openim_sdk.manager; import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; -import io.openim.flutter_openim_sdk.listener.BaseListener; -import io.openim.flutter_openim_sdk.listener.SDKListener; +import io.openim.flutter_openim_sdk.listener.OnBaseListener; +import io.openim.flutter_openim_sdk.listener.OnConnListener; import io.openim.flutter_openim_sdk.util.CommonUtil; import open_im_sdk.Open_im_sdk; @@ -11,18 +11,27 @@ public class IMManager extends BaseManager { public void initSDK(MethodCall methodCall, MethodChannel.Result result) { CommonUtil.runMainThreadReturn(result, Open_im_sdk.initSDK( - jsonValue(methodCall), new SDKListener())); + new OnConnListener(), + value(methodCall, "operationID"), + jsonValue(methodCall)) + ); // CommonUtil.runMainThreadReturn(result, null); } public void login(MethodCall methodCall, MethodChannel.Result result) { Open_im_sdk.login( + new OnBaseListener(result), + value(methodCall, "operationID"), value(methodCall, "uid"), - value(methodCall, "token"), new BaseListener(result)); + value(methodCall, "token") + ); } public void logout(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.logout(new BaseListener(result)); + Open_im_sdk.logout( + new OnBaseListener(result), + value(methodCall, "operationID") + ); } public void getLoginStatus(MethodCall methodCall, MethodChannel.Result result) { @@ -33,25 +42,25 @@ public class IMManager extends BaseManager { // CommonUtil.runMainThreadReturn(result, Open_im_sdk.getLoginUid()); // } - public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.getUsersInfo( - jsonValue(methodCall, "uidList"), new BaseListener(result)); - } +// public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) { +// Open_im_sdk.getUsersInfo( +// jsonValue(methodCall, "uidList"), new BaseListener(result)); +// } - public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.setSelfInfo( - jsonValue(methodCall), new BaseListener(result)); - } +// public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) { +// Open_im_sdk.setSelfInfo( +// jsonValue(methodCall), new BaseListener(result)); +// } - public void forceSyncLoginUerInfo(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.forceSyncLoginUerInfo(); - } +// public void forceSyncLoginUerInfo(MethodCall methodCall, MethodChannel.Result result) { +// Open_im_sdk.forceSyncLoginUerInfo(); +// } // public void forceReConn(MethodCall methodCall, MethodChannel.Result result) { // Open_im_sdk.forceReConn(); // } - public void setSdkLog(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.setSdkLog(value(methodCall, "sdkLog")); - } +// public void setSdkLog(MethodCall methodCall, MethodChannel.Result result) { +// Open_im_sdk.setSdkLog(value(methodCall, "sdkLog")); +// } } diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/manager/MessageManager.java b/android/src/main/java/io/openim/flutter_openim_sdk/manager/MessageManager.java index 3e850a2..c90a7c4 100644 --- a/android/src/main/java/io/openim/flutter_openim_sdk/manager/MessageManager.java +++ b/android/src/main/java/io/openim/flutter_openim_sdk/manager/MessageManager.java @@ -1,28 +1,24 @@ package io.openim.flutter_openim_sdk.manager; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - import io.flutter.plugin.common.MethodCall; import io.flutter.plugin.common.MethodChannel; -import io.openim.flutter_openim_sdk.listener.AdvancedMsgListener; -import io.openim.flutter_openim_sdk.listener.BaseListener; -import io.openim.flutter_openim_sdk.listener.MsgSendProgressListener; +import io.openim.flutter_openim_sdk.listener.OnAdvancedMsgListener; +import io.openim.flutter_openim_sdk.listener.OnBaseListener; +import io.openim.flutter_openim_sdk.listener.OnMsgSendListener; import io.openim.flutter_openim_sdk.util.CommonUtil; -import open_im_sdk.OnAdvancedMsgListener; import open_im_sdk.Open_im_sdk; public class MessageManager extends BaseManager { private final static String KEY_ID = "id"; // private final static Map listeners = new HashMap<>(); - private static boolean initializedListener = false; + /* private static boolean initializedListener = false; private final static Map listeners = new ConcurrentHashMap<>(); -// protected void clearListeners() { -// initializedListener = false; -// listeners.clear(); -// } + protected void clearListeners() { + initializedListener = false; + listeners.clear(); + } private final static OnAdvancedMsgListener sdkMsgListener = new OnAdvancedMsgListener() { @Override @@ -50,21 +46,21 @@ public class MessageManager extends BaseManager { public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) { String key = methodCall.argument(KEY_ID); Open_im_sdk.addAdvancedMsgListener(new AdvancedMsgListener(key)); -// listeners.put(key, new AdvancedMsgListener(key)); -// if (!initializedListener) { -// initializedListener = true; -// Open_im_sdk.addAdvancedMsgListener(sdkMsgListener); -// } + listeners.put(key, new AdvancedMsgListener(key)); + if (!initializedListener) { + initializedListener = true; + Open_im_sdk.addAdvancedMsgListener(sdkMsgListener); + } } public void removeAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) { -// String key = methodCall.argument(KEY_ID); -// listeners.remove(key); -// if (listeners.isEmpty()) { -// initializedListener = false; -// Open_im_sdk.removeAdvancedMsgListener(sdkMsgListener); -// } - } + String key = methodCall.argument(KEY_ID); + listeners.remove(key); + if (listeners.isEmpty()) { + initializedListener = false; + Open_im_sdk.removeAdvancedMsgListener(sdkMsgListener); + } + }*/ /* public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) { @@ -83,63 +79,93 @@ public class MessageManager extends BaseManager { } */ + public void setAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) { + String key = methodCall.argument(KEY_ID); + Open_im_sdk.setAdvancedMsgListener(new OnAdvancedMsgListener(key)); + } public void sendMessage(MethodCall methodCall, MethodChannel.Result result) { - MsgSendProgressListener listener = new MsgSendProgressListener(result, methodCall); - Open_im_sdk.sendMessage(listener, + Open_im_sdk.sendMessage( + new OnMsgSendListener(result, methodCall), + value(methodCall, "operationID"), jsonValue(methodCall, "message"), value(methodCall, "userID"), value(methodCall, "groupID"), - value(methodCall, "onlineUserOnly")); + jsonValue(methodCall, "offlinePushInfo") + ); } public void getHistoryMessageList(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.getHistoryMessageList(new BaseListener(result), jsonValue(methodCall)); + Open_im_sdk.getHistoryMessageList( + new OnBaseListener(result), + value(methodCall, "operationID"), + jsonValue(methodCall) + ); } public void revokeMessage(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.revokeMessage(new BaseListener(result), jsonValue(methodCall)); + Open_im_sdk.revokeMessage( + new OnBaseListener(result), + value(methodCall, "operationID"), + jsonValue(methodCall) + ); } public void deleteMessageFromLocalStorage(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.deleteMessageFromLocalStorage(new BaseListener(result), jsonValue(methodCall)); + Open_im_sdk.deleteMessageFromLocalStorage( + new OnBaseListener(result), + value(methodCall, "operationID"), + jsonValue(methodCall) + ); } - public void deleteMessages(MethodCall methodCall, MethodChannel.Result result) { -// Open_im_sdk.deleteMessages(new BaseListener(result), CommonUtil.getSDKJsonParam(methodCall)); - } +// public void deleteMessages(MethodCall methodCall, MethodChannel.Result result) { +// Open_im_sdk.deleteMessages(new OnBaseListener(result), CommonUtil.getSDKJsonParam(methodCall)); +// } public void insertSingleMessageToLocalStorage(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.insertSingleMessageToLocalStorage(new BaseListener(result), + Open_im_sdk.insertSingleMessageToLocalStorage( + new OnBaseListener(result), + value(methodCall, "operationID"), jsonValue(methodCall, "message"), value(methodCall, "receiverID"), - value(methodCall, "senderID")); + value(methodCall, "senderID") + ); } - public void findMessages(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.findMessages(new BaseListener(result), jsonValue(methodCall, "messageIDList")); - } +// public void findMessages(MethodCall methodCall, MethodChannel.Result result) { +// Open_im_sdk.findMessages(new OnBaseListener(result), jsonValue(methodCall, "messageIDList")); +// } public void markC2CMessageAsRead(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.markC2CMessageAsRead(new BaseListener(result), + Open_im_sdk.markC2CMessageAsRead( + new OnBaseListener(result), + value(methodCall, "operationID"), value(methodCall, "userID"), - jsonValue(methodCall, "messageIDList")); + jsonValue(methodCall, "messageIDList") + ); } public void typingStatusUpdate(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.typingStatusUpdate(value(methodCall, "userID"), - value(methodCall, "typing")); + Open_im_sdk.typingStatusUpdate( + new OnBaseListener(result), + value(methodCall, "operationID"), + value(methodCall, "userID"), + value(methodCall, "msgTip") + ); } public void createTextMessage(MethodCall methodCall, MethodChannel.Result result) { CommonUtil.runMainThreadReturn(result, Open_im_sdk.createTextMessage( + value(methodCall, "operationID"), value(methodCall, "text"))); } public void createTextAtMessage(MethodCall methodCall, MethodChannel.Result result) { CommonUtil.runMainThreadReturn(result, Open_im_sdk.createTextAtMessage( + value(methodCall, "operationID"), value(methodCall, "text"), jsonValue(methodCall, "atUserList"))); } @@ -147,17 +173,20 @@ public class MessageManager extends BaseManager { public void createImageMessage(MethodCall methodCall, MethodChannel.Result result) { CommonUtil.runMainThreadReturn(result, Open_im_sdk.createImageMessage( + value(methodCall, "operationID"), value(methodCall, "imagePath"))); } public void createImageMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) { CommonUtil.runMainThreadReturn(result, Open_im_sdk.createImageMessageFromFullPath( + value(methodCall, "operationID"), value(methodCall, "imagePath"))); } public void createSoundMessage(MethodCall methodCall, MethodChannel.Result result) { CommonUtil.runMainThreadReturn(result, Open_im_sdk.createSoundMessage( + value(methodCall, "operationID"), value(methodCall, "soundPath"), int2long(methodCall, "duration"))); } @@ -165,6 +194,7 @@ public class MessageManager extends BaseManager { public void createSoundMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) { CommonUtil.runMainThreadReturn(result, Open_im_sdk.createSoundMessageFromFullPath( + value(methodCall, "operationID"), value(methodCall, "soundPath"), int2long(methodCall, "duration"))); } @@ -172,6 +202,7 @@ public class MessageManager extends BaseManager { public void createVideoMessage(MethodCall methodCall, MethodChannel.Result result) { CommonUtil.runMainThreadReturn(result, Open_im_sdk.createVideoMessage( + value(methodCall, "operationID"), value(methodCall, "videoPath"), value(methodCall, "videoType"), int2long(methodCall, "duration"), @@ -181,6 +212,7 @@ public class MessageManager extends BaseManager { public void createVideoMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) { CommonUtil.runMainThreadReturn(result, Open_im_sdk.createVideoMessageFromFullPath( + value(methodCall, "operationID"), value(methodCall, "videoPath"), value(methodCall, "videoType"), int2long(methodCall, "duration"), @@ -190,6 +222,7 @@ public class MessageManager extends BaseManager { public void createFileMessage(MethodCall methodCall, MethodChannel.Result result) { CommonUtil.runMainThreadReturn(result, Open_im_sdk.createFileMessage( + value(methodCall, "operationID"), value(methodCall, "filePath"), value(methodCall, "fileName"))); } @@ -197,6 +230,7 @@ public class MessageManager extends BaseManager { public void createFileMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) { CommonUtil.runMainThreadReturn(result, Open_im_sdk.createFileMessageFromFullPath( + value(methodCall, "operationID"), value(methodCall, "filePath"), value(methodCall, "fileName"))); } @@ -204,6 +238,7 @@ public class MessageManager extends BaseManager { public void createMergerMessage(MethodCall methodCall, MethodChannel.Result result) { CommonUtil.runMainThreadReturn(result, Open_im_sdk.createMergerMessage( + value(methodCall, "operationID"), jsonValue(methodCall, "messageList"), value(methodCall, "title"), jsonValue(methodCall, "summaryList"))); @@ -213,11 +248,13 @@ public class MessageManager extends BaseManager { public void createForwardMessage(MethodCall methodCall, MethodChannel.Result result) { CommonUtil.runMainThreadReturn(result, Open_im_sdk.createForwardMessage( + value(methodCall, "operationID"), jsonValue(methodCall, "message"))); } public void createLocationMessage(MethodCall methodCall, MethodChannel.Result result) { CommonUtil.runMainThreadReturn(result, Open_im_sdk.createLocationMessage( + value(methodCall, "operationID"), value(methodCall, "description"), value(methodCall, "longitude"), value(methodCall, "latitude") @@ -226,6 +263,7 @@ public class MessageManager extends BaseManager { public void createCustomMessage(MethodCall methodCall, MethodChannel.Result result) { CommonUtil.runMainThreadReturn(result, Open_im_sdk.createCustomMessage( + value(methodCall, "operationID"), value(methodCall, "data"), value(methodCall, "extension"), value(methodCall, "description") @@ -234,6 +272,7 @@ public class MessageManager extends BaseManager { public void createQuoteMessage(MethodCall methodCall, MethodChannel.Result result) { CommonUtil.runMainThreadReturn(result, Open_im_sdk.createQuoteMessage( + value(methodCall, "operationID"), value(methodCall, "quoteText"), jsonValue(methodCall, "quoteMessage") )); @@ -241,21 +280,28 @@ public class MessageManager extends BaseManager { public void createCardMessage(MethodCall methodCall, MethodChannel.Result result) { CommonUtil.runMainThreadReturn(result, Open_im_sdk.createCardMessage( + value(methodCall, "operationID"), jsonValue(methodCall, "cardMessage") )); } - public void forceSyncMsg(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.forceSyncMsg(); - } +// public void forceSyncMsg(MethodCall methodCall, MethodChannel.Result result) { +// Open_im_sdk.forceSyncMsg(); +// } public void clearC2CHistoryMessage(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.clearC2CHistoryMessage(new BaseListener(result), - value(methodCall, "userID")); + Open_im_sdk.clearC2CHistoryMessage( + new OnBaseListener(result), + value(methodCall, "operationID"), + value(methodCall, "userID") + ); } public void clearGroupHistoryMessage(MethodCall methodCall, MethodChannel.Result result) { - Open_im_sdk.clearGroupHistoryMessage(new BaseListener(result), - value(methodCall, "groupID")); + Open_im_sdk.clearGroupHistoryMessage( + new OnBaseListener(result), + value(methodCall, "operationID"), + value(methodCall, "groupID") + ); } } diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/manager/UserManager.java b/android/src/main/java/io/openim/flutter_openim_sdk/manager/UserManager.java new file mode 100644 index 0000000..c5223f1 --- /dev/null +++ b/android/src/main/java/io/openim/flutter_openim_sdk/manager/UserManager.java @@ -0,0 +1,35 @@ +package io.openim.flutter_openim_sdk.manager; + +import io.flutter.plugin.common.MethodCall; +import io.flutter.plugin.common.MethodChannel; +import io.openim.flutter_openim_sdk.listener.OnBaseListener; +import io.openim.flutter_openim_sdk.listener.OnUserListener; +import open_im_sdk.Open_im_sdk; + +public class UserManager extends BaseManager { + + public void setUserListener(MethodCall methodCall, MethodChannel.Result result) { + Open_im_sdk.setUserListener(new OnUserListener()); + } + + public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) { + Open_im_sdk.getUsersInfo( + new OnBaseListener(result), + value(methodCall, "operationID"), + jsonValue(methodCall, "uidList")); + } + + public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) { + Open_im_sdk.setSelfInfo( + new OnBaseListener(result), + value(methodCall, "operationID"), + jsonValue(methodCall)); + } + + public void getSelfUserInfo(MethodCall methodCall, MethodChannel.Result result) { + Open_im_sdk.getSelfUserInfo( + new OnBaseListener(result), + value(methodCall, "operationID") + ); + } +} diff --git a/android/src/main/java/io/openim/flutter_openim_sdk/util/CommonUtil.java b/android/src/main/java/io/openim/flutter_openim_sdk/util/CommonUtil.java index 325362f..fb3a1bb 100644 --- a/android/src/main/java/io/openim/flutter_openim_sdk/util/CommonUtil.java +++ b/android/src/main/java/io/openim/flutter_openim_sdk/util/CommonUtil.java @@ -32,7 +32,7 @@ public class CommonUtil { runMainThreadReturnError(result, String.valueOf(errorCode), errorMessage, errorDetails); } - public synchronized static void emitEvent(String method, String type, Long errCode, String errMsg, T data) { + public synchronized static void emitEvent(String method, String type, Object errCode, String errMsg, T data) { runMainThread(() -> { Map res = new ArrayMap<>(); if (null != type) { diff --git a/example/lib/main.dart b/example/lib/main.dart index dce3fba..d4e8715 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -36,7 +36,6 @@ class _MyAppState extends State { } void _login() { - if (OpenIM.iMManager.isInitialized) OpenIM.iMManager.login(uid: '', token: ''); } @@ -45,64 +44,27 @@ class _MyAppState extends State { OpenIM.iMManager ..initSDK( platform: Platform.isAndroid ? IMPlatform.android : IMPlatform.ios, - ipApi: '', - ipWs: '', - dbPath: '', - listener: OnInitSDKListener( - onConnecting: () {}, - onConnectFailed: (code, error) {}, - onConnectSuccess: () {}, - onKickedOffline: () {}, - onUserSigExpired: () {}, - onSelfInfoUpdated: (user) {}, - ), + apiAddr: '', + wsAddr: '', + dataDir: '', + listener: OnConnectListener(), ) - + // + ..userManager.setUserListener(OnUserListener()) // Add message listener (remove when not in use) - ..messageManager.addAdvancedMsgListener(OnAdvancedMsgListener( - onRecvMessageRevoked: (msgId) {}, - onRecvC2CReadReceipt: (list) {}, - onRecvNewMessage: (msg) {}, - )) + ..messageManager.setAdvancedMsgListener(OnAdvancedMsgListener()) // Set up message sending progress listener - ..messageManager.setMsgSendProgressListener(OnMsgSendProgressListener( - onProgress: (msgId, progress) {}, - )) + ..messageManager.setMsgSendProgressListener(OnMsgSendProgressListener()) // Set up friend relationship listener - ..friendshipManager.setFriendshipListener(OnFriendshipListener( - onBlackListAdd: (u) {}, - onBlackListDeleted: (u) {}, - onFriendApplicationListAccept: (u) {}, - onFriendApplicationListAdded: (u) {}, - onFriendApplicationListDeleted: (u) {}, - onFriendApplicationListReject: (u) {}, - onFriendInfoChanged: (u) {}, - onFriendListAdded: (u) {}, - onFriendListDeleted: (u) {}, - )) + ..friendshipManager.setFriendshipListener(OnFriendshipListener()) // Set up conversation listener - ..conversationManager.setConversationListener(OnConversationListener( - onConversationChanged: (list) {}, - onNewConversation: (list) {}, - onTotalUnreadMessageCountChanged: (count) {}, - onSyncServerFailed: () {}, - onSyncServerFinish: () {}, - onSyncServerStart: () {}, - )) + ..conversationManager.setConversationListener(OnConversationListener()) // Set up group listener ..groupManager.setGroupListener(OnGroupListener( - onApplicationProcessed: (groupId, opUser, agreeOrReject, opReason) {}, - onGroupCreated: (groupId) {}, - onGroupInfoChanged: (groupId, info) {}, - onMemberEnter: (groupId, list) {}, - onMemberInvited: (groupId, opUser, list) {}, - onMemberKicked: (groupId, opUser, list) {}, - onMemberLeave: (groupId, info) {}, - onReceiveJoinApplication: (groupId, info, opReason) {}, )); } } diff --git a/example/pubspec.lock b/example/pubspec.lock index a3bf065..60d0397 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -68,7 +68,7 @@ packages: path: ".." relative: true source: path - version: "1.0.9" + version: "1.1.1" flutter_test: dependency: "direct dev" description: flutter diff --git a/ios/Classes/BaseCallback.swift b/ios/Classes/BaseCallback.swift index f6590fd..e86283f 100644 --- a/ios/Classes/BaseCallback.swift +++ b/ios/Classes/BaseCallback.swift @@ -8,7 +8,7 @@ import Foundation import OpenIMCore -public class BaseCallback: NSObject, Open_im_sdkBaseProtocol { +public class BaseCallback: NSObject, Open_im_sdk_callbackBaseProtocol { private let result:FlutterResult diff --git a/ios/Classes/Module/ConversationManager.swift b/ios/Classes/Module/ConversationManager.swift index c0fa39d..b321c7c 100644 --- a/ios/Classes/Module/ConversationManager.swift +++ b/ios/Classes/Module/ConversationManager.swift @@ -21,7 +21,7 @@ public class ConversationManager: BaseServiceManager { self["deleteConversation"] = deleteConversation self["setConversationDraft"] = setConversationDraft self["pinConversation"] = pinConversation - self["markSingleMessageHasRead"] = markSingleMessageHasRead + // self["markSingleMessageHasRead"] = markSingleMessageHasRead self["markGroupMessageHasRead"] = markGroupMessageHasRead self["getTotalUnreadMsgCount"] = getTotalUnreadMsgCount self["getConversationIDBySessionType"] = getConversationIDBySessionType @@ -35,43 +35,43 @@ public class ConversationManager: BaseServiceManager { } func getAllConversationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkGetAllConversationList(BaseCallback(result: result)) + Open_im_sdkGetAllConversationList(BaseCallback(result: result), methodCall[string: "operationID"]) } func getConversationListSplit(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkGetConversationListSplit(BaseCallback(result: result), methodCall[int: "offset"], methodCall[int: "count"]) + Open_im_sdkGetConversationListSplit(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "offset"], methodCall[int: "count"]) } func getOneConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkGetOneConversation(methodCall[string: "sourceID"], methodCall[int: "sessionType"], BaseCallback(result: result)) + Open_im_sdkGetOneConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "sessionType"], methodCall[string: "sourceID"]) } func getMultipleConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkGetMultipleConversation(methodCall[jsonString: "conversationIDList"], BaseCallback(result: result)) + Open_im_sdkGetMultipleConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"]) } func deleteConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkDeleteConversation(methodCall[string: "conversationID"], BaseCallback(result: result)) + Open_im_sdkDeleteConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"]) } func setConversationDraft(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkSetConversationDraft(methodCall[string: "conversationID"], methodCall[string: "draftText"], BaseCallback(result: result)) + Open_im_sdkSetConversationDraft(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[string: "draftText"]) } func pinConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkPinConversation(methodCall[string: "conversationID"], methodCall[bool: "isPinned"], BaseCallback(result: result)) + Open_im_sdkPinConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[bool: "isPinned"]) } - func markSingleMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkMarkSingleMessageHasRead(BaseCallback(result: result), methodCall[string: "userID"]) - } + // func markSingleMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ + // Open_im_sdkMarkSingleMessageHasRead(BaseCallback(result: result), methodCall[string: "userID"]) + // } func markGroupMessageHasRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkMarkGroupMessageHasRead(BaseCallback(result: result), methodCall[string: "groupID"]) + Open_im_sdkMarkGroupMessageHasRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"]) } func getTotalUnreadMsgCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkGetTotalUnreadMsgCount(BaseCallback(result: result)) + Open_im_sdkGetTotalUnreadMsgCount(BaseCallback(result: result), methodCall[string: "operationID"]) } func getConversationIDBySessionType(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ @@ -80,16 +80,16 @@ public class ConversationManager: BaseServiceManager { } func setConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkSetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[jsonString: "conversationIDList"], methodCall[int: "status"]) + Open_im_sdkSetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"], methodCall[int: "status"]) } func getConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkGetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[jsonString: "conversationIDList"]) + Open_im_sdkGetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"]) } } -public class ConversationListener: NSObject, Open_im_sdkOnConversationListenerProtocol { +public class ConversationListener: NSObject, Open_im_sdk_callbackOnConversationListenerProtocol { private let channel:FlutterMethodChannel diff --git a/ios/Classes/Module/FriendshipManager.swift b/ios/Classes/Module/FriendshipManager.swift index 03463c9..0db8f6b 100644 --- a/ios/Classes/Module/FriendshipManager.swift +++ b/ios/Classes/Module/FriendshipManager.swift @@ -15,14 +15,15 @@ public class FriendshipManager: BaseServiceManager { self["setFriendListener"] = setFriendListener self["getFriendsInfo"] = getFriendsInfo self["addFriend"] = addFriend - self["getFriendApplicationList"] = getFriendApplicationList + self["getRecvFriendApplicationList"] = getRecvFriendApplicationList + self["getSendFriendApplicationList"] = getSendFriendApplicationList self["getFriendList"] = getFriendList - self["setFriendInfo"] = setFriendInfo - self["addToBlackList"] = addToBlackList - self["getBlackList"] = getBlackList - self["deleteFromBlackList"] = deleteFromBlackList + self["setFriendRemark"] = setFriendRemark + self["addBlacklist"] = addBlacklist + self["getBlacklist"] = getBlacklist + self["removeBlacklist"] = removeBlacklist self["checkFriend"] = checkFriend - self["deleteFromFriendList"] = deleteFromFriendList + self["deleteFriend"] = deleteFriend self["acceptFriendApplication"] = acceptFriendApplication self["refuseFriendApplication"] = refuseFriendApplication // self["forceSyncFriendApplication"] = forceSyncFriendApplication @@ -36,51 +37,55 @@ public class FriendshipManager: BaseServiceManager { } func getFriendsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkGetFriendsInfo(BaseCallback(result: result), methodCall[jsonString: "uidList"]) + Open_im_sdkGetDesignatedFriendsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "uidList"]) } func addFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkAddFriend(BaseCallback(result: result), methodCall.toJsonString()) + Open_im_sdkAddFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString()) } - func getFriendApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkGetFriendApplicationList(BaseCallback(result: result)) + func getRecvFriendApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ + Open_im_sdkGetRecvFriendApplicationList(BaseCallback(result: result), methodCall[string: "operationID"]) } - + + func getSendFriendApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ + Open_im_sdkGetSendFriendApplicationList(BaseCallback(result: result), methodCall[string: "operationID"]) + } + func getFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkGetFriendList(BaseCallback(result: result)) + Open_im_sdkGetFriendList(BaseCallback(result: result), methodCall[string: "operationID"]) } - func setFriendInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkSetFriendInfo(methodCall.toJsonString(), BaseCallback(result: result)) + func setFriendRemark(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ + Open_im_sdkSetFriendRemark(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString()) } - func addToBlackList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkAddToBlackList(BaseCallback(result: result), methodCall[jsonString: "uid"]) + func addBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ + Open_im_sdkAddBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"]) } - func getBlackList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkGetBlackList(BaseCallback(result: result)) + func getBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ + Open_im_sdkGetBlackList(BaseCallback(result: result), methodCall[string: "operationID"]) } - func deleteFromBlackList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkDeleteFromBlackList(BaseCallback(result: result), methodCall[jsonString: "uid"]) + func removeBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ + Open_im_sdkRemoveBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"]) } func checkFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkCheckFriend(BaseCallback(result: result), methodCall[jsonString: "uidList"]) + Open_im_sdkCheckFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "uidList"]) } - func deleteFromFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkDeleteFromFriendList(methodCall[jsonString: "uid"], BaseCallback(result: result)) + func deleteFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ + Open_im_sdkDeleteFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"]) } func acceptFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkAcceptFriendApplication(BaseCallback(result: result), methodCall[jsonString: "uid"]) + Open_im_sdkAcceptFriendApplication(BaseCallback(result: result), methodCall[string: "operationID", methodCall.toJsonString()) } func refuseFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkRefuseFriendApplication(BaseCallback(result: result), methodCall[jsonString: "uid"]) + Open_im_sdkRefuseFriendApplication(BaseCallback(result: result), methodCall[string: "operationID", methodCall.toJsonString()) } // func forceSyncFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ @@ -99,47 +104,47 @@ public class FriendshipManager: BaseServiceManager { // } } -public class FriendshipListener: NSObject, Open_im_sdkOnFriendshipListenerProtocol { +public class FriendshipListener: NSObject, Open_im_sdk_callbackFriendshipListenerProtocol { 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 onBlackAdded(_ userInfo: String?) { + CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onBlacklistAdded", 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 onBlackDeleted(_ 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 onFriendApplicationAccepted(_ applyUserInfo: String?) { + CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationAccepted", 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 onFriendApplicationAdded(_ applyUserInfo: String?) { + CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationAdded", 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 onFriendApplicationDeleted(_ applyUserInfo: String?) { + CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationDeleted", 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 onFriendApplicationRejected(_ applyUserInfo: String?) { + CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendApplicationRejected", 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 onFriendAdded(_ friendInfo: String?) { + CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendAdded", 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) + public func onFriendDeleted(_ friendInfo: String?) { + CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendDeleted", errCode: nil, errMsg: nil, data: friendInfo) } } diff --git a/ios/Classes/Module/GroupManager.swift b/ios/Classes/Module/GroupManager.swift index 3d4e33b..d31aeb6 100644 --- a/ios/Classes/Module/GroupManager.swift +++ b/ios/Classes/Module/GroupManager.swift @@ -24,7 +24,8 @@ public class GroupManager: BaseServiceManager { self["joinGroup"] = joinGroup self["quitGroup"] = quitGroup self["transferGroupOwner"] = transferGroupOwner - self["getGroupApplicationList"] = getGroupApplicationList + self["getRecvGroupApplicationList"] = getRecvGroupApplicationList + self["getSendGroupApplicationList"] = getSendGroupApplicationList self["acceptGroupApplication"] = acceptGroupApplication self["refuseGroupApplication"] = refuseGroupApplication // self["forceSyncApplyGroupRequest"] = forceSyncApplyGroupRequest @@ -39,62 +40,66 @@ public class GroupManager: BaseServiceManager { } func inviteUserToGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkInviteUserToGroup(methodCall[string: "gid"], methodCall[string: "reason"], - methodCall[jsonString: "uidList"], BaseCallback(result: result)) + Open_im_sdkInviteUserToGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"], + methodCall[jsonString: "uidList"]) } func kickGroupMember(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkKickGroupMember(methodCall[string: "gid"], methodCall[string: "reason"], - methodCall[jsonString: "uidList"], BaseCallback(result: result)) + Open_im_sdkKickGroupMember(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"], + methodCall[jsonString: "uidList"]) } func getGroupMembersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkGetGroupMembersInfo(methodCall[string: "gid"], methodCall[jsonString: "uidList"], BaseCallback(result: result)) + Open_im_sdkGetGroupMembersInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[jsonString: "uidList"]) } func getGroupMemberList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkGetGroupMemberList(methodCall[string: "gid"], methodCall[int32: "filter"], - methodCall[int32: "next"], BaseCallback(result: result)) + Open_im_sdkGetGroupMemberList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[int32: "filter"], + methodCall[int32: "offset"], methodCall[int32: "count"]) } func getJoinedGroupList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkGetJoinedGroupList(BaseCallback(result: result)) + Open_im_sdkGetJoinedGroupList(BaseCallback(result: result), methodCall[string: "operationID"]) } func createGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkCreateGroup(methodCall[jsonString: "gInfo"], methodCall[jsonString: "memberList"], BaseCallback(result: result)) + Open_im_sdkCreateGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "gInfo"], methodCall[jsonString: "memberList"]) } func setGroupInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkSetGroupInfo(methodCall[jsonString: "gInfo"], BaseCallback(result: result)) + Open_im_sdkSetGroupInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[jsonString: "gInfo"]) } func getGroupsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkGetGroupsInfo(methodCall[jsonString: "gidList"], BaseCallback(result: result)) + Open_im_sdkGetGroupsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "gidList"]) } func joinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkJoinGroup(methodCall[string: "gid"], methodCall[string: "reason"], BaseCallback(result: result)) + Open_im_sdkJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "reason"]) } func quitGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkQuitGroup(methodCall[string: "gid"], BaseCallback(result: result)) + Open_im_sdkQuitGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"]) } func transferGroupOwner(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkTransferGroupOwner(methodCall[string: "gid"], methodCall[string: "uid"], BaseCallback(result: result)) + Open_im_sdkTransferGroupOwner(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "uid"]) } - func getGroupApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkGetGroupApplicationList(BaseCallback(result: result)) + func getRecvGroupApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ + Open_im_sdkGetRecvGroupApplicationList(BaseCallback(result: result), methodCall[string: "operationID"]) } + func getSendGroupApplicationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ + Open_im_sdkGetSendGroupApplicationList(BaseCallback(result: result), methodCall[string: "operationID"]) + } + func acceptGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkAcceptGroupApplication(methodCall[jsonString: "application"], methodCall[string: "reason"], BaseCallback(result: result)) + Open_im_sdkAcceptGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "uid"], methodCall[string: "handleMsg"]) } func refuseGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkRefuseGroupApplication(methodCall[jsonString: "application"], methodCall[string: "reason"], BaseCallback(result: result)) + Open_im_sdkRefuseGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "gid"], methodCall[string: "uid"], methodCall[string: "handleMsg"]) } // func forceSyncApplyGroupRequest(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { @@ -118,7 +123,7 @@ public class GroupManager: BaseServiceManager { // } } -public class GroupListener: NSObject, Open_im_sdkOnGroupListenerProtocol { +public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol { private let channel:FlutterMethodChannel @@ -126,73 +131,51 @@ public class GroupListener: NSObject, Open_im_sdkOnGroupListenerProtocol { self.channel = channel } - public func onApplicationProcessed(_ groupId: String?, opUser: String?, agreeOrReject AgreeOrReject: Int32, opReason: String?) { - var values: [String: Any] = [:] - values["groupId"] = groupId - values["opUser"] = opUser - values["agreeOrReject"] = AgreeOrReject - values["opReason"] = opReason - CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onApplicationProcessed", errCode: nil, errMsg: nil, data: values) + public func onGroupApplicationAccepted(_ s: String?) { + CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationAccepted", errCode: nil, errMsg: nil, data: s) } -// public func onApplicationProcessed(_ s: String?,s1: String?,i: Int?,s2: String?) { -// let values: NSMutableDictionary = NSMutableDictionary(capacity: 0) -// values.setValue(s, forKey: "groupId") -// values.setValue(s1, forKey: "opUser") -// values.setValue(i, forKey: "agreeOrReject") -// values.setValue(s2, forKey: "opReason") -// CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onApplicationProcessed", errCode: nil, errMsg: nil, data: values) -// } - - public func onGroupCreated(_ s: String?) { - var values: [String: Any] = [:] - values["groupId"] = s - CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupCreated", errCode: nil, errMsg: nil, data: values) + public func onGroupApplicationAdded(_ s: String?) { + CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationAdded", errCode: nil, errMsg: nil, data: s) } - public func onGroupInfoChanged(_ s: String?, groupInfo s1: String?) { - var values: [String: Any] = [:] - values["groupId"] = s - values["groupInfo"] = s1 - CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupInfoChanged", errCode: nil, errMsg: nil, data: values) + public func onGroupApplicationDeleted(_ s: String?) { + CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationDeleted", errCode: nil, errMsg: nil, data: s) } - public func onMemberEnter(_ s: String?, memberList s1: String?) { - var values: [String: Any] = [:] - values["groupId"] = s - values["memberList"] = s1 - CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onMemberEnter", errCode: nil, errMsg: nil, data: values) + public func onGroupApplicationRejected(_ s: String?) { + CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationRejected", errCode: nil, errMsg: nil, data: s) } - public func onMemberInvited(_ s: String?,opUser s1: String?, memberList s2: String?) { - var values: [String: Any] = [:] - values["groupId"] = s - values["opUser"] = s1 - values["memberList"] = s2 - CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onMemberInvited", errCode: nil, errMsg: nil, data: values) + public func onGroupInfoChanged(_ s: String?) { + CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupInfoChanged", errCode: nil, errMsg: nil, data: s) } - public func onMemberKicked(_ s: String?,opUser s1: String?,memberList s2: String?) { - var values: [String: Any] = [:] - values["groupId"] = s - values["opUser"] = s1 - values["memberList"] = s2 - CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onMemberKicked", errCode: nil, errMsg: nil, data: values) + public func onGroupMemberAdded(_ s: String?) { + CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberAdded", errCode: nil, errMsg: nil, data: s) } - public func onMemberLeave(_ s: String?,member s1: String?) { - var values: [String: Any] = [:] - values["groupId"] = s - values["member"] = s1 - CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onMemberLeave", errCode: nil, errMsg: nil, data: values) + public func onGroupMemberDeleted(_ s: String?,member s1: String?) { + CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberDeleted", errCode: nil, errMsg: nil, data: s) } - public func onReceiveJoinApplication(_ s: String?,member s1: String?,opReason s2: String?) { - var values: [String: Any] = [:] - values["groupId"] = s - values["member"] = s1 - values["opReason"] = s2 - CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onReceiveJoinApplication", errCode: nil, errMsg: nil, data: values) + public func onGroupMemberInfoChanged(_ s: String?) { + CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberInfoChanged", errCode: nil, errMsg: nil, data: s) } + public func onJoinedGroupAdded(_ s: String?) { + CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onJoinedGroupAdded", errCode: nil, errMsg: nil, data: s) + } + + public func onJoinedGroupDeleted(_ s: String?) { + CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onJoinedGroupDeleted", errCode: nil, errMsg: nil, data: s) + } + + public func onReceiveJoinGroupApplicationAdded(_ s: String?) { + CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onReceiveJoinGroupApplicationAdded", errCode: nil, errMsg: nil, data: s) + } + + public func onReceiveJoinGroupApplicationDeleted(_ s: String?) { + CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onReceiveJoinGroupApplicationDeleted", errCode: nil, errMsg: nil, data: s) + } } diff --git a/ios/Classes/Module/IMManager.swift b/ios/Classes/Module/IMManager.swift index ca0f57e..5b606f7 100644 --- a/ios/Classes/Module/IMManager.swift +++ b/ios/Classes/Module/IMManager.swift @@ -18,24 +18,24 @@ public class IMMananger: BaseServiceManager { self["logout"] = logout self["getLoginStatus"] = getLoginStatus // self["getLoginUid"] = getLoginUid - self["getUsersInfo"] = getUsersInfo - self["setSelfInfo"] = setSelfInfo - self["forceSyncLoginUerInfo"] = forceSyncLoginUerInfo + // self["getUsersInfo"] = getUsersInfo + // self["setSelfInfo"] = setSelfInfo + // self["forceSyncLoginUerInfo"] = forceSyncLoginUerInfo // self["forceReConn"] = forceReConn - self["setSdkLog"] = setSdkLog + // self["setSdkLog"] = setSdkLog } func initSDK(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkInitSDK(methodCall.toJsonString(), SDKListener(channel: self.channel)) + Open_im_sdkInitSDK(ConnListener(channel: self.channel), methodCall[string: "operationID"], methodCall.toJsonString()) callBack(result) } func login(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { - Open_im_sdkLogin(methodCall[string: "uid"], methodCall[string: "token"], BaseCallback(result: result)) + Open_im_sdkLogin(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "uid"], methodCall[string: "token"]) } func logout(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { - Open_im_sdkLogout(BaseCallback(result: result)) + Open_im_sdkLogout(BaseCallback(result: result), methodCall[string: "operationID"]) } func getLoginStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { @@ -46,29 +46,29 @@ public class IMMananger: BaseServiceManager { // callBack(result, Open_im_sdkGetLoginUser()) // } - func getUsersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { - Open_im_sdkGetUsersInfo(methodCall[jsonString: "uidList"], BaseCallback(result: result)) - } + // func getUsersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { + // Open_im_sdkGetUsersInfo(methodCall[jsonString: "uidList"], BaseCallback(result: result)) + // } - func setSelfInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { - Open_im_sdkSetSelfInfo(methodCall.toJsonString(), BaseCallback(result: result)) - } + // func setSelfInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { + // Open_im_sdkSetSelfInfo(methodCall.toJsonString(), BaseCallback(result: result)) + // } - func forceSyncLoginUerInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { - Open_im_sdkForceSyncLoginUerInfo() - callBack(result) - } + // func forceSyncLoginUerInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { + // Open_im_sdkForceSyncLoginUerInfo() + // callBack(result) + // } - func setSdkLog(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { - Open_im_sdkSetSdkLog(methodCall[int32: "sdkLog"]) - } + // func setSdkLog(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { + // Open_im_sdkSetSdkLog(methodCall[int32: "sdkLog"]) + // } // func forceReConn(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { // Open_im_sdkForceReConn() // callBack(result) // } } -public class SDKListener: NSObject, Open_im_sdkIMSDKListenerProtocol { +public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol { private let channel:FlutterMethodChannel init(channel:FlutterMethodChannel) { @@ -76,26 +76,22 @@ public class SDKListener: NSObject, Open_im_sdkIMSDKListenerProtocol { } public func onConnectFailed(_ errCode: Int, errMsg: String?) { - CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onConnectFailed", errCode: errCode, errMsg: errMsg, data: nil) + CommonUtil.emitEvent(channel: self.channel, method: "connectListener", 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) + CommonUtil.emitEvent(channel: self.channel, method: "connectListener", 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) + CommonUtil.emitEvent(channel: self.channel, method: "connectListener", 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) + CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onKickedOffline", errCode: nil, errMsg: nil, data: nil) } public func onUserTokenExpired() { - CommonUtil.emitEvent(channel: self.channel, method: "initSDKListener", type: "onUserTokenExpired", errCode: nil, errMsg: nil, data: nil) + CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onUserTokenExpired", errCode: nil, errMsg: nil, data: nil) } } diff --git a/ios/Classes/Module/MessageManager.swift b/ios/Classes/Module/MessageManager.swift index 4b1617d..6c5690a 100644 --- a/ios/Classes/Module/MessageManager.swift +++ b/ios/Classes/Module/MessageManager.swift @@ -10,20 +10,19 @@ import OpenIMCore public class MessageManager: BaseServiceManager { private let KEY_ID: String = "id" - private var listeners: [String: AdvancedMsgListener] = [:] + // private var listeners: [String: AdvancedMsgListener] = [:] public override func registerHandlers() { super.registerHandlers() - self["addAdvancedMsgListener"] = addAdvancedMsgListener - self["removeAdvancedMsgListener"] = removeAdvancedMsgListener + self["setAdvancedMsgListener"] = setAdvancedMsgListener self["sendMessage"] = sendMessage self["getHistoryMessageList"] = getHistoryMessageList self["revokeMessage"] = revokeMessage self["deleteMessageFromLocalStorage"] = deleteMessageFromLocalStorage self["deleteMessages"] = deleteMessages self["insertSingleMessageToLocalStorage"] = insertSingleMessageToLocalStorage - self["findMessages"] = findMessages + // self["findMessages"] = findMessages self["markC2CMessageAsRead"] = markC2CMessageAsRead self["typingStatusUpdate"] = typingStatusUpdate self["createTextMessage"] = createTextMessage @@ -35,56 +34,41 @@ public class MessageManager: BaseServiceManager { self["createVideoMessage"] = createVideoMessage self["createVideoMessageFromFullPath"] = createVideoMessageFromFullPath self["createFileMessage"] = createFileMessage + self["createFileMessageFromFullPath"] = createFileMessageFromFullPath self["createMergerMessage"] = createMergerMessage self["createForwardMessage"] = createForwardMessage self["createLocationMessage"] = createLocationMessage self["createCustomMessage"] = createCustomMessage self["createQuoteMessage"] = createQuoteMessage self["createCardMessage"] = createCardMessage - self["forceSyncMsg"] = forceSyncMsg + // self["forceSyncMsg"] = forceSyncMsg self["clearC2CHistoryMessage"] = clearC2CHistoryMessage self["clearGroupHistoryMessage"] = clearGroupHistoryMessage } - func addAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ + func setAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ let key = methodCall[string: KEY_ID] - if listeners[key] == nil { - let lis = AdvancedMsgListener(channel: channel, id: key) - listeners[key] = lis - Open_im_sdkAddAdvancedMsgListener(lis) - print("=================add msg listener======\n\(lis)") - } - callBack(result) - } - - func removeAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - let key = methodCall[string: KEY_ID] - if let lis = listeners[key] { - listeners[key] = nil -// Open_im_sdkRemoveAdvancedMsgListener(lis) - } + let lis = AdvancedMsgListener(channel: channel, id: key) + open_im_sdkSetAdvancedMsgListener(lis) callBack(result) } func sendMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel,result: result,methodCall: methodCall) -// sendMsgProgressListener.setCall(methodCall: methodCall) -// sendMsgProgressListener.setResult(result: result) - print("===============sendMessage===============") - Open_im_sdkSendMessage(sendMsgProgressListener, methodCall[jsonString: "message"], methodCall[string: "userID"], - methodCall[string: "groupID"], methodCall[bool: "onlineUserOnly"]) + Open_im_sdkSendMessage(sendMsgProgressListener, methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[string: "userID"], + methodCall[string: "groupID"], methodCall[jsonString: "offlinePushInfo"]) } func getHistoryMessageList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkGetHistoryMessageList(BaseCallback(result: result), methodCall.toJsonString()) + Open_im_sdkGetHistoryMessageList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString()) } func revokeMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkRevokeMessage(BaseCallback(result: result), methodCall.toJsonString()) + Open_im_sdkRevokeMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString()) } func deleteMessageFromLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkDeleteMessageFromLocalStorage(BaseCallback(result: result), methodCall.toJsonString()) + Open_im_sdkDeleteMessageFromLocalStorage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString()) } // deprecated @@ -92,112 +76,111 @@ public class MessageManager: BaseServiceManager { } func insertSingleMessageToLocalStorage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkInsertSingleMessageToLocalStorage(BaseCallback(result: result), methodCall[jsonString: "message"], + Open_im_sdkInsertSingleMessageToLocalStorage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[string: "receiverID"], methodCall[string: "senderID"]) } - func findMessages(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkFindMessages(BaseCallback(result: result), methodCall[jsonString: "messageIDList"]) - } + // func findMessages(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ + // Open_im_sdkFindMessages(BaseCallback(result: result), methodCall[jsonString: "messageIDList"]) + // } func markC2CMessageAsRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkMarkC2CMessageAsRead(BaseCallback(result: result), methodCall[string: "userID"], methodCall[jsonString: "messageIDList"]) + Open_im_sdkMarkC2CMessageAsRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[jsonString: "messageIDList"]) } func typingStatusUpdate(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkTypingStatusUpdate(methodCall[string: "userID"], methodCall[string: "typing"]) - callBack(result) + Open_im_sdkTypingStatusUpdate(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[string: "msgTip"]) } func createTextMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - callBack(result, Open_im_sdkCreateTextMessage(methodCall[string: "text"])) + callBack(result, Open_im_sdkCreateTextMessage(methodCall[string: "operationID"], methodCall[string: "text"])) } func createTextAtMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - callBack(result, Open_im_sdkCreateTextAtMessage(methodCall[string: "text"], methodCall[jsonString: "atUserList"])) + callBack(result, Open_im_sdkCreateTextAtMessage(methodCall[string: "operationID"], methodCall[string: "text"], methodCall[jsonString: "atUserList"])) } func createImageMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - callBack(result, Open_im_sdkCreateImageMessage(methodCall[string: "imagePath"])) + callBack(result, Open_im_sdkCreateImageMessage(methodCall[string: "operationID"], methodCall[string: "imagePath"])) } func createImageMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - callBack(result, Open_im_sdkCreateImageMessageFromFullPath(methodCall[string: "imagePath"])) + callBack(result, Open_im_sdkCreateImageMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "imagePath"])) } func createSoundMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - callBack(result, Open_im_sdkCreateSoundMessage(methodCall[string: "soundPath"], methodCall[int64: "duration"])) + callBack(result, Open_im_sdkCreateSoundMessage(methodCall[string: "operationID"], methodCall[string: "soundPath"], methodCall[int64: "duration"])) } func createSoundMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - callBack(result, Open_im_sdkCreateSoundMessageFromFullPath(methodCall[string: "soundPath"], methodCall[int64: "duration"])) + callBack(result, Open_im_sdkCreateSoundMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "soundPath"], methodCall[int64: "duration"])) } func createVideoMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - let prama = Open_im_sdkCreateVideoMessage(methodCall[string: "videoPath"], methodCall[string: "videoType"], + let prama = Open_im_sdkCreateVideoMessage(methodCall[string: "operationID"], methodCall[string: "videoPath"], methodCall[string: "videoType"], methodCall[int64: "duration"], methodCall[string: "snapshotPath"]) callBack(result, prama) } func createVideoMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - let prama = Open_im_sdkCreateVideoMessageFromFullPath(methodCall[string: "videoPath"], methodCall[string: "videoType"], + let prama = Open_im_sdkCreateVideoMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "videoPath"], methodCall[string: "videoType"], methodCall[int64: "duration"], methodCall[string: "snapshotPath"]) callBack(result, prama) } func createFileMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - callBack(result, Open_im_sdkCreateFileMessage(methodCall[string: "filePath"], methodCall[string: "fileName"])) + callBack(result, Open_im_sdkCreateFileMessage(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"])) } func createFileMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - callBack(result, Open_im_sdkCreateFileMessageFromFullPath(methodCall[string: "filePath"], methodCall[string: "fileName"])) + callBack(result, Open_im_sdkCreateFileMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"])) } func createMergerMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - let prama = Open_im_sdkCreateMergerMessage(methodCall[jsonString: "messageList"], methodCall[string: "title"], + let prama = Open_im_sdkCreateMergerMessage(methodCall[string: "operationID"], methodCall[jsonString: "messageList"], methodCall[string: "title"], methodCall[jsonString: "summaryList"]) callBack(result, prama) } func createForwardMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - callBack(result, Open_im_sdkCreateForwardMessage(methodCall[jsonString: "message"])) + callBack(result, Open_im_sdkCreateForwardMessage(methodCall[string: "operationID"], methodCall[jsonString: "message"])) } func createLocationMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - let prama = Open_im_sdkCreateLocationMessage(methodCall[string: "description"], + let prama = Open_im_sdkCreateLocationMessage(methodCall[string: "operationID"], methodCall[string: "description"], methodCall[double: "longitude"], methodCall[double: "latitude"]) callBack(result, prama) } func createCustomMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - let prama = Open_im_sdkCreateCustomMessage(methodCall[string: "data"], + let prama = Open_im_sdkCreateCustomMessage(methodCall[string: "operationID"], methodCall[string: "data"], methodCall[string: "extension"], methodCall[string: "description"]) callBack(result, prama) } func createQuoteMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - let prama = Open_im_sdkCreateQuoteMessage(methodCall[string: "quoteText"], methodCall[jsonString: "quoteMessage"]) + let prama = Open_im_sdkCreateQuoteMessage(methodCall[string: "operationID"], methodCall[string: "quoteText"], methodCall[jsonString: "quoteMessage"]) callBack(result, prama) } func createCardMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - callBack(result, Open_im_sdkCreateCardMessage(methodCall[jsonString: "cardMessage"])) + callBack(result, Open_im_sdkCreateCardMessage(methodCall[string: "operationID"], methodCall[jsonString: "cardMessage"])) } - func forceSyncMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkForceSyncMsg() - callBack(result) - } + // func forceSyncMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ + // Open_im_sdkForceSyncMsg() + // callBack(result) + // } func clearC2CHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkClearC2CHistoryMessage(BaseCallback(result: result), methodCall[string: "userID"]) + Open_im_sdkClearC2CHistoryMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"]) } func clearGroupHistoryMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ - Open_im_sdkClearGroupHistoryMessage(BaseCallback(result: result), methodCall[string: "groupID"]) + Open_im_sdkClearGroupHistoryMessage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"]) } - public class SendMsgProgressListener: NSObject, Open_im_sdkSendMsgCallBackProtocol { + public class SendMsgProgressListener: NSObject, Open_im_sdk_callbackSendMsgCallBackProtocol { private let channel: FlutterMethodChannel private let result: FlutterResult private let call: FlutterMethodCall @@ -217,7 +200,6 @@ public class MessageManager: BaseServiceManager { // } 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)) } } @@ -226,7 +208,6 @@ public class MessageManager: BaseServiceManager { // return // } var values: [String: Any] = [:] - print("=================onProgress============\nprogress:\(progress)") let message = call[dict: "message"] values["clientMsgID"] = message["clientMsgID"] values["progress"] = progress @@ -234,13 +215,12 @@ public class MessageManager: BaseServiceManager { } public func onSuccess(_ data: String?) { - print("=================onSuccess============\nsuccess:\(data!)") DispatchQueue.main.async { self.result(data) } } } - public class AdvancedMsgListener: NSObject, Open_im_sdkOnAdvancedMsgListenerProtocol { + public class AdvancedMsgListener: NSObject, Open_im_sdk_callbackOnAdvancedMsgListenerProtocol { private let channel: FlutterMethodChannel private let id: String diff --git a/ios/Classes/Module/UserManager.swift b/ios/Classes/Module/UserManager.swift new file mode 100644 index 0000000..a723406 --- /dev/null +++ b/ios/Classes/Module/UserManager.swift @@ -0,0 +1,43 @@ + +import Foundation +import OpenIMCore + +public class UserManager: BaseServiceManager { + + public override func registerHandlers() { + super.registerHandlers() + self["getUsersInfo"] = getUsersInfo + self["setSelfInfo"] = setSelfInfo + self["getSelfUserInfo"] = getSelfUserInfo + } + + func setUserListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){ + Open_im_sdkSetUserListener(UserListener(channel: channel)) + callBack(result) + } + + func getUsersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { + Open_im_sdkGetUsersInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "uidList"]) + } + + func setSelfInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { + Open_im_sdkSetSelfInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString()) + } + + func getSelfUserInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) { + Open_im_sdkGetSelfUserInfo(BaseCallback(result: result), methodCall[string: "operationID"]) + } +} + +public class UserListener: NSObject, Open_im_sdk_callbackOnUserListenerProtocol { + + private let channel:FlutterMethodChannel + + init(channel:FlutterMethodChannel) { + self.channel = channel + } + + public func onSelfInfoUpdated(_ userInfo: String?) { + CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onSelfInfoUpdated", errCode: nil, errMsg: nil, data: userInfo) + } +} diff --git a/ios/Classes/SwiftFlutterOpenimSdkPlugin.swift b/ios/Classes/SwiftFlutterOpenimSdkPlugin.swift index cc84123..b562fb2 100644 --- a/ios/Classes/SwiftFlutterOpenimSdkPlugin.swift +++ b/ios/Classes/SwiftFlutterOpenimSdkPlugin.swift @@ -8,6 +8,7 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin { let friendshipManager: FriendshipManager let messageManager: MessageManager let groupManager: GroupManager + let userManger: UserManager init(channel: FlutterMethodChannel) { self.imManager = IMMananger(channel: channel) @@ -15,6 +16,7 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin { self.friendshipManager = FriendshipManager(channel: channel) self.messageManager = MessageManager(channel: channel) self.groupManager = GroupManager(channel: channel) + self.userManger = UserManager(channel: channel) } public static func register(with registrar: FlutterPluginRegistrar) { @@ -36,6 +38,8 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin { friendshipManager.handleMethod(call: call, result: result) case "groupManager": groupManager.handleMethod(call: call, result: result) + case "userManager": + userManger.handleMethod(call: call, result: result) default: print("Handle ManagerName Error: \(managerName) not found") } diff --git a/ios/Framework/OpenIMCore.framework/Headers/OpenIMCore.h b/ios/Framework/OpenIMCore.framework/Headers/OpenIMCore.h index 577bdd8..9534b48 100644 --- a/ios/Framework/OpenIMCore.framework/Headers/OpenIMCore.h +++ b/ios/Framework/OpenIMCore.framework/Headers/OpenIMCore.h @@ -2,12 +2,14 @@ // Objective-C API for talking to the following Go packages // // open_im_sdk/open_im_sdk +// open_im_sdk/open_im_sdk_callback // // File is generated by gomobile bind. Do not edit. #ifndef __OpenIMCore_FRAMEWORK_H__ #define __OpenIMCore_FRAMEWORK_H__ #include "Open_im_sdk.objc.h" +#include "Open_im_sdk_callback.objc.h" #include "Universe.objc.h" #endif diff --git a/ios/Framework/OpenIMCore.framework/Headers/Open_im_sdk.objc.h b/ios/Framework/OpenIMCore.framework/Headers/Open_im_sdk.objc.h index 63b5ace..7361321 100644 --- a/ios/Framework/OpenIMCore.framework/Headers/Open_im_sdk.objc.h +++ b/ios/Framework/OpenIMCore.framework/Headers/Open_im_sdk.objc.h @@ -10,1809 +10,197 @@ #include "ref.h" #include "Universe.objc.h" - -@class Open_im_sdkAgreeOrRejectGroupMember; -@class Open_im_sdkArrMsg; -@class Open_im_sdkChatLog; -@class Open_im_sdkConversationListener; -@class Open_im_sdkConversationStruct; -@class Open_im_sdkFileBaseInfo; -@class Open_im_sdkFriend; -@class Open_im_sdkGatherFormat; -@class Open_im_sdkGeneralWsReq; -@class Open_im_sdkGeneralWsResp; -@class Open_im_sdkGetMaxAndMinSeqReq; -@class Open_im_sdkGetMaxAndMinSeqResp; -@class Open_im_sdkGroupApplicationInfo; -@class Open_im_sdkGroupApplicationResponseReq; -@class Open_im_sdkGroupReqListInfo; -@class Open_im_sdkIMConfig; -@class Open_im_sdkIMManager; -@class Open_im_sdkLogInfo; -@class Open_im_sdkLogger; -@class Open_im_sdkMessageReceipt; -@class Open_im_sdkMsgData; -@class Open_im_sdkMsgFormat; -@class Open_im_sdkMsgStruct; -@class Open_im_sdkNotificationContent; -@class Open_im_sdkPictureBaseInfo; -@class Open_im_sdkPullMessageBySeqListReq; -@class Open_im_sdkPullMessageBySeqListResp; -@class Open_im_sdkPullMsgReq; -@class Open_im_sdkPullUserMsgResp; -@class Open_im_sdkSendMsgRespFromServer; -@class Open_im_sdkSliceMock; -@class Open_im_sdkSoundBaseInfo; -@class Open_im_sdkSoundElem; -@class Open_im_sdkTransferGroupOwnerReq; -@class Open_im_sdkUid2Flag; -@class Open_im_sdkUserRelated; -@class Open_im_sdkUserSendMsgReq; -@class Open_im_sdkUserSendMsgResp; -@class Open_im_sdkVideoBaseInfo; -@class Open_im_sdkWsMsgData; -@class Open_im_sdkWsSendMsgResp; -@class Open_im_sdkWsSubMsg; -@protocol Open_im_sdkBase; -@class Open_im_sdkBase; -@protocol Open_im_sdkIMSDKListener; -@class Open_im_sdkIMSDKListener; -@protocol Open_im_sdkOnAdvancedMsgListener; -@class Open_im_sdkOnAdvancedMsgListener; -@protocol Open_im_sdkOnConversationListener; -@class Open_im_sdkOnConversationListener; -@protocol Open_im_sdkOnFriendshipListener; -@class Open_im_sdkOnFriendshipListener; -@protocol Open_im_sdkOnGroupListener; -@class Open_im_sdkOnGroupListener; -@protocol Open_im_sdkSendMsgCallBack; -@class Open_im_sdkSendMsgCallBack; - -@protocol Open_im_sdkBase -- (void)onError:(long)errCode errMsg:(NSString* _Nullable)errMsg; -- (void)onSuccess:(NSString* _Nullable)data; -@end - -@protocol Open_im_sdkIMSDKListener -- (void)onConnectFailed:(long)ErrCode ErrMsg:(NSString* _Nullable)ErrMsg; -- (void)onConnectSuccess; -- (void)onConnecting; -- (void)onKickedOffline; -- (void)onSelfInfoUpdated:(NSString* _Nullable)userInfo; -- (void)onUserTokenExpired; -@end - -@protocol Open_im_sdkOnAdvancedMsgListener -- (void)onRecvC2CReadReceipt:(NSString* _Nullable)msgReceiptList; -- (void)onRecvMessageRevoked:(NSString* _Nullable)msgId; -- (void)onRecvNewMessage:(NSString* _Nullable)message; -@end - -@protocol Open_im_sdkOnConversationListener -- (void)onConversationChanged:(NSString* _Nullable)conversationList; -- (void)onNewConversation:(NSString* _Nullable)conversationList; -- (void)onSyncServerFailed; -- (void)onSyncServerFinish; -- (void)onSyncServerStart; -- (void)onTotalUnreadMessageCountChanged:(int32_t)totalUnreadCount; -@end - -@protocol Open_im_sdkOnFriendshipListener -- (void)onBlackListAdd:(NSString* _Nullable)userInfo; -- (void)onBlackListDeleted:(NSString* _Nullable)userInfo; -- (void)onFriendApplicationListAccept:(NSString* _Nullable)applyUserInfo; -- (void)onFriendApplicationListAdded:(NSString* _Nullable)applyUserInfo; -- (void)onFriendApplicationListDeleted:(NSString* _Nullable)applyUserInfo; -- (void)onFriendApplicationListReject:(NSString* _Nullable)applyUserInfo; -- (void)onFriendInfoChanged:(NSString* _Nullable)friendInfo; -- (void)onFriendListAdded:(NSString* _Nullable)friendInfo; -- (void)onFriendListDeleted:(NSString* _Nullable)friendInfo; -@end - -@protocol Open_im_sdkOnGroupListener -- (void)onApplicationProcessed:(NSString* _Nullable)groupId opUser:(NSString* _Nullable)opUser AgreeOrReject:(int32_t)AgreeOrReject opReason:(NSString* _Nullable)opReason; -- (void)onGroupCreated:(NSString* _Nullable)groupId; -- (void)onGroupInfoChanged:(NSString* _Nullable)groupId groupInfo:(NSString* _Nullable)groupInfo; -- (void)onMemberEnter:(NSString* _Nullable)groupId memberList:(NSString* _Nullable)memberList; -- (void)onMemberInvited:(NSString* _Nullable)groupId opUser:(NSString* _Nullable)opUser memberList:(NSString* _Nullable)memberList; -- (void)onMemberKicked:(NSString* _Nullable)groupId opUser:(NSString* _Nullable)opUser memberList:(NSString* _Nullable)memberList; -- (void)onMemberLeave:(NSString* _Nullable)groupId member:(NSString* _Nullable)member; -- (void)onReceiveJoinApplication:(NSString* _Nullable)groupId member:(NSString* _Nullable)member opReason:(NSString* _Nullable)opReason; -@end - -@protocol Open_im_sdkSendMsgCallBack -- (void)onError:(long)errCode errMsg:(NSString* _Nullable)errMsg; -- (void)onProgress:(long)progress; -- (void)onSuccess:(NSString* _Nullable)data; -@end - -@interface Open_im_sdkAgreeOrRejectGroupMember : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) NSString* _Nonnull groupId; -@property (nonatomic) NSString* _Nonnull userId; -@property (nonatomic) long role; -// skipped field AgreeOrRejectGroupMember.JoinTime with unsupported type: uint64 - -@property (nonatomic) NSString* _Nonnull nickName; -@property (nonatomic) NSString* _Nonnull faceUrl; -@property (nonatomic) NSString* _Nonnull reason; -@end - -@interface Open_im_sdkArrMsg : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -// skipped field ArrMsg.SingleData with unsupported type: []open_im_sdk/open_im_sdk.MsgData - -// skipped field ArrMsg.GroupData with unsupported type: []open_im_sdk/open_im_sdk.MsgData - -@end - -@interface Open_im_sdkChatLog : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) NSString* _Nonnull msgId; -@property (nonatomic) NSString* _Nonnull sendID; -@property (nonatomic) int32_t isRead; -@property (nonatomic) int64_t seq; -@property (nonatomic) int32_t status; -@property (nonatomic) int32_t sessionType; -@property (nonatomic) NSString* _Nonnull recvID; -@property (nonatomic) int32_t contentType; -@property (nonatomic) int32_t msgFrom; -@property (nonatomic) NSString* _Nonnull content; -// skipped field ChatLog.Remark with unsupported type: database/sql.NullString - -@property (nonatomic) int32_t senderPlatformID; -@property (nonatomic) int64_t sendTime; -@property (nonatomic) int64_t createTime; -@end - -@interface Open_im_sdkConversationListener : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) id _Nullable conversationListenerx; -// skipped field ConversationListener.MsgListenerList with unsupported type: []open_im_sdk/open_im_sdk.OnAdvancedMsgListener - -@end - -@interface Open_im_sdkConversationStruct : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) NSString* _Nonnull conversationID; -@property (nonatomic) long conversationType; -@property (nonatomic) NSString* _Nonnull userID; -@property (nonatomic) NSString* _Nonnull groupID; -@property (nonatomic) NSString* _Nonnull showName; -@property (nonatomic) NSString* _Nonnull faceURL; -@property (nonatomic) long recvMsgOpt; -@property (nonatomic) long unreadCount; -@property (nonatomic) NSString* _Nonnull latestMsg; -@property (nonatomic) int64_t latestMsgSendTime; -@property (nonatomic) NSString* _Nonnull draftText; -@property (nonatomic) int64_t draftTimestamp; -@property (nonatomic) long isPinned; -@end - -@interface Open_im_sdkFileBaseInfo : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) NSString* _Nonnull filePath; -@property (nonatomic) NSString* _Nonnull uuid; -@property (nonatomic) NSString* _Nonnull sourceURL; -@property (nonatomic) NSString* _Nonnull fileName; -@property (nonatomic) int64_t fileSize; -@end - -@interface Open_im_sdkFriend : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@end - -@interface Open_im_sdkGatherFormat : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -/** - * @inject_tag: json:"id" - */ -@property (nonatomic) NSString* _Nonnull id_; -// skipped field GatherFormat.List with unsupported type: []*open_im_sdk/open_im_sdk.MsgFormat - -// skipped field GatherFormat.XXX_NoUnkeyedLiteral with unsupported type: struct{} - -@property (nonatomic) NSData* _Nullable xxX_unrecognized; -@property (nonatomic) int32_t xxX_sizecache; -// skipped method GatherFormat.Descriptor with unsupported parameter or return types - -- (void)protoMessage; -- (void)reset; -- (NSString* _Nonnull)string; -- (void)xxX_DiscardUnknown; -- (NSData* _Nullable)xxX_Marshal:(NSData* _Nullable)b deterministic:(BOOL)deterministic error:(NSError* _Nullable* _Nullable)error; -// skipped method GatherFormat.XXX_Merge with unsupported parameter or return types - -- (long)xxX_Size; -- (BOOL)xxX_Unmarshal:(NSData* _Nullable)b error:(NSError* _Nullable* _Nullable)error; -@end - -@interface Open_im_sdkGeneralWsReq : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) int32_t reqIdentifier; -@property (nonatomic) NSString* _Nonnull token; -@property (nonatomic) NSString* _Nonnull sendID; -@property (nonatomic) NSString* _Nonnull operationID; -@property (nonatomic) NSString* _Nonnull msgIncr; -@property (nonatomic) NSData* _Nullable data; -@end - -@interface Open_im_sdkGeneralWsResp : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) long reqIdentifier; -@property (nonatomic) long errCode; -@property (nonatomic) NSString* _Nonnull errMsg; -@property (nonatomic) NSString* _Nonnull msgIncr; -@property (nonatomic) NSString* _Nonnull operationID; -@property (nonatomic) NSData* _Nullable data; -@end - -@interface Open_im_sdkGetMaxAndMinSeqReq : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -// skipped field GetMaxAndMinSeqReq.XXX_NoUnkeyedLiteral with unsupported type: struct{} - -@property (nonatomic) NSData* _Nullable xxX_unrecognized; -@property (nonatomic) int32_t xxX_sizecache; -// skipped method GetMaxAndMinSeqReq.Descriptor with unsupported parameter or return types - -- (void)protoMessage; -- (void)reset; -- (NSString* _Nonnull)string; -- (void)xxX_DiscardUnknown; -- (NSData* _Nullable)xxX_Marshal:(NSData* _Nullable)b deterministic:(BOOL)deterministic error:(NSError* _Nullable* _Nullable)error; -// skipped method GetMaxAndMinSeqReq.XXX_Merge with unsupported parameter or return types - -- (long)xxX_Size; -- (BOOL)xxX_Unmarshal:(NSData* _Nullable)b error:(NSError* _Nullable* _Nullable)error; -@end - -@interface Open_im_sdkGetMaxAndMinSeqResp : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) int64_t maxSeq; -@property (nonatomic) int64_t minSeq; -// skipped field GetMaxAndMinSeqResp.XXX_NoUnkeyedLiteral with unsupported type: struct{} - -@property (nonatomic) NSData* _Nullable xxX_unrecognized; -@property (nonatomic) int32_t xxX_sizecache; -// skipped method GetMaxAndMinSeqResp.Descriptor with unsupported parameter or return types - -- (void)protoMessage; -- (void)reset; -- (NSString* _Nonnull)string; -- (void)xxX_DiscardUnknown; -- (NSData* _Nullable)xxX_Marshal:(NSData* _Nullable)b deterministic:(BOOL)deterministic error:(NSError* _Nullable* _Nullable)error; -// skipped method GetMaxAndMinSeqResp.XXX_Merge with unsupported parameter or return types - -- (long)xxX_Size; -- (BOOL)xxX_Unmarshal:(NSData* _Nullable)b error:(NSError* _Nullable* _Nullable)error; -@end - -@interface Open_im_sdkGroupApplicationInfo : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -// skipped field GroupApplicationInfo.Info with unsupported type: open_im_sdk/open_im_sdk.accessOrRefuseGroupApplicationReq - -@property (nonatomic) NSString* _Nonnull handUserID; -@property (nonatomic) NSString* _Nonnull handUserName; -@property (nonatomic) NSString* _Nonnull handUserIcon; -@end - -@interface Open_im_sdkGroupApplicationResponseReq : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) NSString* _Nonnull operationID; -@property (nonatomic) NSString* _Nonnull ownerID; -@property (nonatomic) NSString* _Nonnull groupID; -@property (nonatomic) NSString* _Nonnull fromUserID; -@property (nonatomic) NSString* _Nonnull fromUserNickName; -@property (nonatomic) NSString* _Nonnull fromUserFaceUrl; -@property (nonatomic) NSString* _Nonnull toUserID; -@property (nonatomic) NSString* _Nonnull toUserNickName; -@property (nonatomic) NSString* _Nonnull toUserFaceUrl; -@property (nonatomic) int64_t addTime; -@property (nonatomic) NSString* _Nonnull requestMsg; -@property (nonatomic) NSString* _Nonnull handledMsg; -@property (nonatomic) int32_t type; -@property (nonatomic) int32_t handleStatus; -@property (nonatomic) int32_t handleResult; -@end - -@interface Open_im_sdkGroupReqListInfo : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) NSString* _Nonnull id_; -@property (nonatomic) NSString* _Nonnull groupID; -@property (nonatomic) NSString* _Nonnull fromUserID; -@property (nonatomic) NSString* _Nonnull toUserID; -@property (nonatomic) int32_t flag; -@property (nonatomic) NSString* _Nonnull requestMsg; -@property (nonatomic) NSString* _Nonnull handledMsg; -@property (nonatomic) int64_t addTime; -@property (nonatomic) NSString* _Nonnull fromUserNickname; -@property (nonatomic) NSString* _Nonnull toUserNickname; -@property (nonatomic) NSString* _Nonnull fromUserFaceUrl; -@property (nonatomic) NSString* _Nonnull toUserFaceUrl; -@property (nonatomic) NSString* _Nonnull handledUser; -@property (nonatomic) int32_t type; -@property (nonatomic) int32_t handleStatus; -@property (nonatomic) int32_t handleResult; -- (NSString* _Nonnull)key; -// skipped method GroupReqListInfo.Value with unsupported parameter or return types - -@end - -@interface Open_im_sdkIMConfig : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) int32_t platform; -@property (nonatomic) NSString* _Nonnull ipApiAddr; -@property (nonatomic) NSString* _Nonnull ipWsAddr; -@property (nonatomic) NSString* _Nonnull dbDir; -@end - -@interface Open_im_sdkIMManager : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) long loginState; -@end - -@interface Open_im_sdkLogInfo : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) NSString* _Nonnull info; -@end - -@interface Open_im_sdkLogger : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -// skipped field Logger.Logger with unsupported type: *github.com/sirupsen/logrus.Logger - -@property (nonatomic) long pid; -// skipped method Logger.AddHook with unsupported parameter or return types - -// skipped method Logger.Debug with unsupported parameter or return types - -// skipped method Logger.Debugf with unsupported parameter or return types - -// skipped method Logger.Debugln with unsupported parameter or return types - -// skipped method Logger.Error with unsupported parameter or return types - -// skipped method Logger.Errorf with unsupported parameter or return types - -// skipped method Logger.Errorln with unsupported parameter or return types - -- (void)exit:(long)code; -// skipped method Logger.Fatal with unsupported parameter or return types - -// skipped method Logger.Fatalf with unsupported parameter or return types - -// skipped method Logger.Fatalln with unsupported parameter or return types - -// skipped method Logger.GetLevel with unsupported parameter or return types - -// skipped method Logger.Info with unsupported parameter or return types - -// skipped method Logger.Infof with unsupported parameter or return types - -// skipped method Logger.Infoln with unsupported parameter or return types - -// skipped method Logger.IsLevelEnabled with unsupported parameter or return types - -// skipped method Logger.Log with unsupported parameter or return types - -// skipped method Logger.Logf with unsupported parameter or return types - -// skipped method Logger.Logln with unsupported parameter or return types - -// skipped method Logger.Panic with unsupported parameter or return types - -// skipped method Logger.Panicf with unsupported parameter or return types - -// skipped method Logger.Panicln with unsupported parameter or return types - -// skipped method Logger.Print with unsupported parameter or return types - -// skipped method Logger.Printf with unsupported parameter or return types - -// skipped method Logger.Println with unsupported parameter or return types - -// skipped method Logger.ReplaceHooks with unsupported parameter or return types - -// skipped method Logger.SetFormatter with unsupported parameter or return types - -// skipped method Logger.SetLevel with unsupported parameter or return types - -- (void)setNoLock; -// skipped method Logger.SetOutput with unsupported parameter or return types - -- (void)setReportCaller:(BOOL)reportCaller; -// skipped method Logger.Trace with unsupported parameter or return types - -// skipped method Logger.Tracef with unsupported parameter or return types - -// skipped method Logger.Traceln with unsupported parameter or return types - -// skipped method Logger.Warn with unsupported parameter or return types - -// skipped method Logger.Warnf with unsupported parameter or return types - -// skipped method Logger.Warning with unsupported parameter or return types - -// skipped method Logger.Warningf with unsupported parameter or return types - -// skipped method Logger.Warningln with unsupported parameter or return types - -// skipped method Logger.Warnln with unsupported parameter or return types - -// skipped method Logger.WithContext with unsupported parameter or return types - -// skipped method Logger.WithError with unsupported parameter or return types - -// skipped method Logger.WithField with unsupported parameter or return types - -// skipped method Logger.WithFields with unsupported parameter or return types - -// skipped method Logger.WithTime with unsupported parameter or return types - -// skipped method Logger.Writer with unsupported parameter or return types - -// skipped method Logger.WriterLevel with unsupported parameter or return types - -@end - -@interface Open_im_sdkMessageReceipt : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) NSString* _Nonnull userID; -// skipped field MessageReceipt.MsgIdList with unsupported type: []string - -@property (nonatomic) int64_t readTime; -@property (nonatomic) int32_t msgFrom; -@property (nonatomic) int32_t contentType; -@property (nonatomic) int32_t sessionType; -@end - -@interface Open_im_sdkMsgData : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) NSString* _Nonnull sendID; -@property (nonatomic) NSString* _Nonnull recvID; -@property (nonatomic) int32_t sessionType; -@property (nonatomic) int32_t msgFrom; -@property (nonatomic) int32_t contentType; -@property (nonatomic) NSString* _Nonnull serverMsgID; -@property (nonatomic) NSString* _Nonnull content; -@property (nonatomic) int64_t sendTime; -@property (nonatomic) int64_t seq; -@property (nonatomic) int32_t senderPlatformID; -@property (nonatomic) NSString* _Nonnull senderNickName; -@property (nonatomic) NSString* _Nonnull senderFaceURL; -@property (nonatomic) NSString* _Nonnull clientMsgID; -// skipped field MsgData.XXX_NoUnkeyedLiteral with unsupported type: struct{} - -@property (nonatomic) NSData* _Nullable xxX_unrecognized; -@property (nonatomic) int32_t xxX_sizecache; -// skipped method MsgData.Descriptor with unsupported parameter or return types - -- (void)protoMessage; -- (void)reset; -- (NSString* _Nonnull)string; -- (void)xxX_DiscardUnknown; -- (NSData* _Nullable)xxX_Marshal:(NSData* _Nullable)b deterministic:(BOOL)deterministic error:(NSError* _Nullable* _Nullable)error; -// skipped method MsgData.XXX_Merge with unsupported parameter or return types - -- (long)xxX_Size; -- (BOOL)xxX_Unmarshal:(NSData* _Nullable)b error:(NSError* _Nullable* _Nullable)error; -@end - -@interface Open_im_sdkMsgFormat : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -/** - * @inject_tag: json:"sendID" - */ -@property (nonatomic) NSString* _Nonnull sendID; -/** - * @inject_tag: json:"recvID" - */ -@property (nonatomic) NSString* _Nonnull recvID; -/** - * @inject_tag: json:"msgFrom" - */ -@property (nonatomic) int32_t msgFrom; -/** - * @inject_tag: json:"contentType" - */ -@property (nonatomic) int32_t contentType; -/** - * @inject_tag: json:"serverMsgID" - */ -@property (nonatomic) NSString* _Nonnull serverMsgID; -/** - * @inject_tag: json:"content" - */ -@property (nonatomic) NSString* _Nonnull content; -/** - * @inject_tag: json:"seq" - */ -@property (nonatomic) int64_t seq; -/** - * @inject_tag: json:"sendTime" - */ -@property (nonatomic) int64_t sendTime; -/** - * @inject_tag: json:"senderPlatformID" - */ -@property (nonatomic) int32_t senderPlatformID; -/** - * @inject_tag: json:"senderNickName" - */ -@property (nonatomic) NSString* _Nonnull senderNickName; -/** - * @inject_tag: json:"senderFaceUrl" - */ -@property (nonatomic) NSString* _Nonnull senderFaceURL; -/** - * @inject_tag: json:"clientMsgID" - */ -@property (nonatomic) NSString* _Nonnull clientMsgID; -// skipped field MsgFormat.XXX_NoUnkeyedLiteral with unsupported type: struct{} - -@property (nonatomic) NSData* _Nullable xxX_unrecognized; -@property (nonatomic) int32_t xxX_sizecache; -// skipped method MsgFormat.Descriptor with unsupported parameter or return types - -- (void)protoMessage; -- (void)reset; -- (NSString* _Nonnull)string; -- (void)xxX_DiscardUnknown; -- (NSData* _Nullable)xxX_Marshal:(NSData* _Nullable)b deterministic:(BOOL)deterministic error:(NSError* _Nullable* _Nullable)error; -// skipped method MsgFormat.XXX_Merge with unsupported parameter or return types - -- (long)xxX_Size; -- (BOOL)xxX_Unmarshal:(NSData* _Nullable)b error:(NSError* _Nullable* _Nullable)error; -@end - -@interface Open_im_sdkMsgStruct : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) NSString* _Nonnull clientMsgID; -@property (nonatomic) NSString* _Nonnull serverMsgID; -@property (nonatomic) int64_t createTime; -@property (nonatomic) int64_t sendTime; -@property (nonatomic) int32_t sessionType; -@property (nonatomic) NSString* _Nonnull sendID; -@property (nonatomic) NSString* _Nonnull recvID; -@property (nonatomic) int32_t msgFrom; -@property (nonatomic) int32_t contentType; -@property (nonatomic) int32_t platformID; -// skipped field MsgStruct.ForceList with unsupported type: []string - -@property (nonatomic) NSString* _Nonnull senderNickName; -@property (nonatomic) NSString* _Nonnull senderFaceURL; -@property (nonatomic) NSString* _Nonnull groupID; -@property (nonatomic) NSString* _Nonnull content; -@property (nonatomic) int64_t seq; -@property (nonatomic) BOOL isRead; -@property (nonatomic) int32_t status; -@property (nonatomic) NSString* _Nonnull remark; -// skipped field MsgStruct.PictureElem with unsupported type: struct{SourcePath string "json:\"sourcePath\""; SourcePicture open_im_sdk/open_im_sdk.PictureBaseInfo "json:\"sourcePicture\""; BigPicture open_im_sdk/open_im_sdk.PictureBaseInfo "json:\"bigPicture\""; SnapshotPicture open_im_sdk/open_im_sdk.PictureBaseInfo "json:\"snapshotPicture\""} - -// skipped field MsgStruct.SoundElem with unsupported type: struct{UUID string "json:\"uuid\""; SoundPath string "json:\"soundPath\""; SourceURL string "json:\"sourceUrl\""; DataSize int64 "json:\"dataSize\""; Duration int64 "json:\"duration\""} - -// skipped field MsgStruct.VideoElem with unsupported type: struct{VideoPath string "json:\"videoPath\""; VideoUUID string "json:\"videoUUID\""; VideoURL string "json:\"videoUrl\""; VideoType string "json:\"videoType\""; VideoSize int64 "json:\"videoSize\""; Duration int64 "json:\"duration\""; SnapshotPath string "json:\"snapshotPath\""; SnapshotUUID string "json:\"snapshotUUID\""; SnapshotSize int64 "json:\"snapshotSize\""; SnapshotURL string "json:\"snapshotUrl\""; SnapshotWidth int32 "json:\"snapshotWidth\""; SnapshotHeight int32 "json:\"snapshotHeight\""} - -// skipped field MsgStruct.FileElem with unsupported type: struct{FilePath string "json:\"filePath\""; UUID string "json:\"uuid\""; SourceURL string "json:\"sourceUrl\""; FileName string "json:\"fileName\""; FileSize int64 "json:\"fileSize\""} - -// skipped field MsgStruct.MergeElem with unsupported type: struct{Title string "json:\"title\""; AbstractList []string "json:\"abstractList\""; MultiMessage []*open_im_sdk/open_im_sdk.MsgStruct "json:\"multiMessage\""} - -// skipped field MsgStruct.AtElem with unsupported type: struct{Text string "json:\"text\""; AtUserList []string "json:\"atUserList\""; IsAtSelf bool "json:\"isAtSelf\""} - -// skipped field MsgStruct.LocationElem with unsupported type: struct{Description string "json:\"description\""; Longitude float64 "json:\"longitude\""; Latitude float64 "json:\"latitude\""} - -// skipped field MsgStruct.CustomElem with unsupported type: struct{Data string "json:\"data\""; Description string "json:\"description\""; Extension string "json:\"extension\""} - -// skipped field MsgStruct.QuoteElem with unsupported type: struct{Text string "json:\"text\""; QuoteMessage *open_im_sdk/open_im_sdk.MsgStruct "json:\"quoteMessage\""} - -@end - -@interface Open_im_sdkNotificationContent : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) int32_t isDisplay; -@property (nonatomic) NSString* _Nonnull defaultTips; -@property (nonatomic) NSString* _Nonnull detail; -@end - -@interface Open_im_sdkPictureBaseInfo : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) NSString* _Nonnull uuid; -@property (nonatomic) NSString* _Nonnull type; -@property (nonatomic) int64_t size; -@property (nonatomic) int32_t width; -@property (nonatomic) int32_t height; -@property (nonatomic) NSString* _Nonnull url; -@end - -@interface Open_im_sdkPullMessageBySeqListReq : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -// skipped field PullMessageBySeqListReq.SeqList with unsupported type: []int64 - -// skipped field PullMessageBySeqListReq.XXX_NoUnkeyedLiteral with unsupported type: struct{} - -@property (nonatomic) NSData* _Nullable xxX_unrecognized; -@property (nonatomic) int32_t xxX_sizecache; -// skipped method PullMessageBySeqListReq.Descriptor with unsupported parameter or return types - -- (void)protoMessage; -- (void)reset; -- (NSString* _Nonnull)string; -- (void)xxX_DiscardUnknown; -- (NSData* _Nullable)xxX_Marshal:(NSData* _Nullable)b deterministic:(BOOL)deterministic error:(NSError* _Nullable* _Nullable)error; -// skipped method PullMessageBySeqListReq.XXX_Merge with unsupported parameter or return types - -- (long)xxX_Size; -- (BOOL)xxX_Unmarshal:(NSData* _Nullable)b error:(NSError* _Nullable* _Nullable)error; -@end - -@interface Open_im_sdkPullMessageBySeqListResp : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) int64_t maxSeq; -@property (nonatomic) int64_t minSeq; -// skipped field PullMessageBySeqListResp.SingleUserMsg with unsupported type: []*open_im_sdk/open_im_sdk.GatherFormat - -// skipped field PullMessageBySeqListResp.GroupUserMsg with unsupported type: []*open_im_sdk/open_im_sdk.GatherFormat - -// skipped field PullMessageBySeqListResp.XXX_NoUnkeyedLiteral with unsupported type: struct{} - -@property (nonatomic) NSData* _Nullable xxX_unrecognized; -@property (nonatomic) int32_t xxX_sizecache; -// skipped method PullMessageBySeqListResp.Descriptor with unsupported parameter or return types - -- (void)protoMessage; -- (void)reset; -- (NSString* _Nonnull)string; -- (void)xxX_DiscardUnknown; -- (NSData* _Nullable)xxX_Marshal:(NSData* _Nullable)b deterministic:(BOOL)deterministic error:(NSError* _Nullable* _Nullable)error; -// skipped method PullMessageBySeqListResp.XXX_Merge with unsupported parameter or return types - -- (long)xxX_Size; -- (BOOL)xxX_Unmarshal:(NSData* _Nullable)b error:(NSError* _Nullable* _Nullable)error; -@end - -@interface Open_im_sdkPullMsgReq : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) NSString* _Nonnull userID; -@property (nonatomic) NSString* _Nonnull groupID; -@property (nonatomic) Open_im_sdkMsgStruct* _Nullable startMsg; -@property (nonatomic) long count; -@end - -@interface Open_im_sdkPullUserMsgResp : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) long errCode; -@property (nonatomic) NSString* _Nonnull errMsg; -@property (nonatomic) long reqIdentifier; -@property (nonatomic) long msgIncr; -// skipped field PullUserMsgResp.Data with unsupported type: open_im_sdk/open_im_sdk.paramsPullUserMsgDataResp - -@end - -@interface Open_im_sdkSendMsgRespFromServer : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) long errCode; -@property (nonatomic) NSString* _Nonnull errMsg; -@property (nonatomic) long reqIdentifier; -// skipped field SendMsgRespFromServer.Data with unsupported type: struct{ServerMsgID string "json:\"serverMsgID\""; ClientMsgID string "json:\"clientMsgID\""; SendTime int64 "json:\"sendTime\""} - -@end - -@interface Open_im_sdkSliceMock : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@end - -@interface Open_im_sdkSoundBaseInfo : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) NSString* _Nonnull uuid; -@property (nonatomic) NSString* _Nonnull soundPath; -@property (nonatomic) NSString* _Nonnull sourceURL; -@property (nonatomic) int64_t dataSize; -@property (nonatomic) int64_t duration; -@end - -@interface Open_im_sdkSoundElem : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) NSString* _Nonnull uuid; -@property (nonatomic) NSString* _Nonnull soundPath; -@property (nonatomic) NSString* _Nonnull sourceURL; -@property (nonatomic) int64_t dataSize; -@property (nonatomic) int64_t duration; -@end - -@interface Open_im_sdkTransferGroupOwnerReq : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) NSString* _Nonnull groupID; -@property (nonatomic) NSString* _Nonnull oldOwner; -@property (nonatomic) NSString* _Nonnull newOwner; -@property (nonatomic) NSString* _Nonnull operationID; -@end - -@interface Open_im_sdkUid2Flag : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) NSString* _Nonnull uid; -@property (nonatomic) int32_t flag; -@end - -@interface Open_im_sdkUserRelated : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -// skipped field UserRelated.ConversationCh with unsupported type: chan open_im_sdk/open_im_sdk.cmd2Value - -// skipped field UserRelated.SvrConf with unsupported type: open_im_sdk/open_im_sdk.IMConfig - -@property (nonatomic) NSString* _Nonnull loginUid; -// skipped field UserRelated.IMManager with unsupported type: open_im_sdk/open_im_sdk.IMManager - -// skipped field UserRelated.Friend with unsupported type: open_im_sdk/open_im_sdk.Friend - -// skipped field UserRelated.ConversationListener with unsupported type: open_im_sdk/open_im_sdk.ConversationListener - -- (void)acceptFriendApplication:(id _Nullable)callback uid:(NSString* _Nullable)uid; -- (void)acceptGroupApplication:(NSString* _Nullable)application reason:(NSString* _Nullable)reason callback:(id _Nullable)callback; -- (void)addAdvancedMsgListener:(id _Nullable)listener; -// skipped method UserRelated.AddCh with unsupported parameter or return types - -- (void)addFriend:(id _Nullable)callback paramsReq:(NSString* _Nullable)paramsReq; -- (void)addToBlackList:(id _Nullable)callback blackUid:(NSString* _Nullable)blackUid; -- (void)checkFriend:(id _Nullable)callback uidList:(NSString* _Nullable)uidList; -- (void)clearC2CHistoryMessage:(id _Nullable)callback userID:(NSString* _Nullable)userID; -- (void)clearGroupHistoryMessage:(id _Nullable)callback groupID:(NSString* _Nullable)groupID; -- (NSString* _Nonnull)createCardMessage:(NSString* _Nullable)cardInfo; -- (NSString* _Nonnull)createCustomMessage:(NSString* _Nullable)data extension:(NSString* _Nullable)extension description:(NSString* _Nullable)description; -- (NSString* _Nonnull)createFileMessage:(NSString* _Nullable)filePath fileName:(NSString* _Nullable)fileName; -- (NSString* _Nonnull)createFileMessageByURL:(NSString* _Nullable)fileBaseInfo; -- (NSString* _Nonnull)createFileMessageFromFullPath:(NSString* _Nullable)fileFullPath fileName:(NSString* _Nullable)fileName; -- (NSString* _Nonnull)createForwardMessage:(NSString* _Nullable)m; -- (void)createGroup:(NSString* _Nullable)gInfo memberList:(NSString* _Nullable)memberList callback:(id _Nullable)callback; -- (NSString* _Nonnull)createImageMessage:(NSString* _Nullable)imagePath; -- (NSString* _Nonnull)createImageMessageByURL:(NSString* _Nullable)sourcePicture bigPicture:(NSString* _Nullable)bigPicture snapshotPicture:(NSString* _Nullable)snapshotPicture; -- (NSString* _Nonnull)createImageMessageFromFullPath:(NSString* _Nullable)imageFullPath; -- (NSString* _Nonnull)createLocationMessage:(NSString* _Nullable)description longitude:(double)longitude latitude:(double)latitude; -- (NSString* _Nonnull)createMergerMessage:(NSString* _Nullable)messageList title:(NSString* _Nullable)title summaryList:(NSString* _Nullable)summaryList; -- (NSString* _Nonnull)createQuoteMessage:(NSString* _Nullable)text message:(NSString* _Nullable)message; -- (NSString* _Nonnull)createSoundMessage:(NSString* _Nullable)soundPath duration:(int64_t)duration; -- (NSString* _Nonnull)createSoundMessageByURL:(NSString* _Nullable)soundBaseInfo; -- (NSString* _Nonnull)createSoundMessageFromFullPath:(NSString* _Nullable)soundPath duration:(int64_t)duration; -- (NSString* _Nonnull)createTextAtMessage:(NSString* _Nullable)text atUserList:(NSString* _Nullable)atUserList; -- (NSString* _Nonnull)createTextMessage:(NSString* _Nullable)text; -- (NSString* _Nonnull)createVideoMessage:(NSString* _Nullable)videoPath videoType:(NSString* _Nullable)videoType duration:(int64_t)duration snapshotPath:(NSString* _Nullable)snapshotPath; -- (NSString* _Nonnull)createVideoMessageByURL:(NSString* _Nullable)videoBaseInfo; -- (NSString* _Nonnull)createVideoMessageFromFullPath:(NSString* _Nullable)videoFullPath videoType:(NSString* _Nullable)videoType duration:(int64_t)duration snapshotFullPath:(NSString* _Nullable)snapshotFullPath; -- (void)delCh:(NSString* _Nullable)msgIncr; -- (void)deleteConversation:(NSString* _Nullable)conversationID callback:(id _Nullable)callback; -- (void)deleteFromBlackList:(id _Nullable)callback deleteUid:(NSString* _Nullable)deleteUid; -- (void)deleteFromFriendList:(NSString* _Nullable)deleteUid callback:(id _Nullable)callback; -- (void)deleteMessageFromLocalStorage:(id _Nullable)callback message:(NSString* _Nullable)message; -- (void)findMessages:(id _Nullable)callback messageIDList:(NSString* _Nullable)messageIDList; -- (void)forceReConn; -- (void)forceSyncApplyGroupRequest; -- (void)forceSyncBlackList; -- (void)forceSyncFriend; -- (void)forceSyncFriendApplication; -- (void)forceSyncGroupRequest; -- (void)forceSyncJoinedGroup; -- (void)forceSyncJoinedGroupMember; -- (void)forceSyncLoginUserInfo; -- (BOOL)forceSyncMsg; -- (NSString* _Nonnull)genMsgIncr; -- (void)getAllConversationList:(id _Nullable)callback; -- (void)getBlackList:(id _Nullable)callback; -// skipped method UserRelated.GetCh with unsupported parameter or return types - -- (void)getConversationListSplit:(id _Nullable)callback offset:(long)offset count:(long)count; -- (void)getConversationRecvMessageOpt:(id _Nullable)callback conversationIDList:(NSString* _Nullable)conversationIDList; -- (void)getFriendApplicationList:(id _Nullable)callback; -- (void)getFriendList:(id _Nullable)callback; -- (void)getFriendsInfo:(id _Nullable)callback uidList:(NSString* _Nullable)uidList; -- (void)getGroupApplicationList:(id _Nullable)callback; -- (void)getGroupMemberList:(NSString* _Nullable)groupId filter:(int32_t)filter next:(int32_t)next callback:(id _Nullable)callback; -- (void)getGroupMembersInfo:(NSString* _Nullable)groupId userList:(NSString* _Nullable)userList callback:(id _Nullable)callback; -- (void)getGroupsInfo:(NSString* _Nullable)groupIdList callback:(id _Nullable)callback; -- (void)getHistoryMessageList:(id _Nullable)callback getMessageOptions:(NSString* _Nullable)getMessageOptions; -- (void)getJoinedGroupList:(id _Nullable)callback; -- (long)getLoginStatus; -- (NSString* _Nonnull)getLoginUser; -- (int64_t)getMinSeqSvr; -- (void)getMultipleConversation:(NSString* _Nullable)conversationIDList callback:(id _Nullable)callback; -- (void)getOneConversation:(NSString* _Nullable)sourceID sessionType:(long)sessionType callback:(id _Nullable)callback; -- (void)getTotalUnreadMsgCount:(id _Nullable)callback; -- (void)getUsersInfo:(NSString* _Nullable)uIDList cb:(id _Nullable)cb; -// skipped method UserRelated.GroupApplicationProcessedCallback with unsupported parameter or return types - -- (BOOL)initSDK:(NSString* _Nullable)config cb:(id _Nullable)cb; -- (NSString* _Nonnull)insertGroupMessageToLocalStorage:(id _Nullable)callback message:(NSString* _Nullable)message groupID:(NSString* _Nullable)groupID sender:(NSString* _Nullable)sender; -- (NSString* _Nonnull)insertSingleMessageToLocalStorage:(id _Nullable)callback message:(NSString* _Nullable)message userID:(NSString* _Nullable)userID sender:(NSString* _Nullable)sender; -- (void)inviteUserToGroup:(NSString* _Nullable)groupId reason:(NSString* _Nullable)reason userList:(NSString* _Nullable)userList callback:(id _Nullable)callback; -- (void)joinGroup:(NSString* _Nullable)groupId message:(NSString* _Nullable)message callback:(id _Nullable)callback; -- (void)kickGroupMember:(NSString* _Nullable)groupId reason:(NSString* _Nullable)reason userList:(NSString* _Nullable)userList callback:(id _Nullable)callback; -- (void)login:(NSString* _Nullable)uid tk:(NSString* _Nullable)tk callback:(id _Nullable)callback; -- (void)logout:(id _Nullable)callback; -- (void)markC2CMessageAsRead:(id _Nullable)callback receiver:(NSString* _Nullable)receiver msgIDList:(NSString* _Nullable)msgIDList; -- (void)markGroupMessageHasRead:(id _Nullable)callback groupID:(NSString* _Nullable)groupID; -/** - * Deprecated - */ -- (void)markSingleMessageHasRead:(id _Nullable)callback userID:(NSString* _Nullable)userID; -// skipped method UserRelated.OnMemberInvited with unsupported parameter or return types - -// skipped method UserRelated.OnMemberKicked with unsupported parameter or return types - -- (void)pinConversation:(NSString* _Nullable)conversationID isPinned:(BOOL)isPinned callback:(id _Nullable)callback; -// skipped method UserRelated.Prepare with unsupported parameter or return types - -// skipped method UserRelated.Query with unsupported parameter or return types - -- (void)quitGroup:(NSString* _Nullable)groupId callback:(id _Nullable)callback; -- (void)refuseFriendApplication:(id _Nullable)callback uid:(NSString* _Nullable)uid; -- (void)refuseGroupApplication:(NSString* _Nullable)application reason:(NSString* _Nullable)reason callback:(id _Nullable)callback; -- (BOOL)resetConversation:(NSString* _Nullable)conversationID error:(NSError* _Nullable* _Nullable)error; -- (void)revokeMessage:(id _Nullable)callback message:(NSString* _Nullable)message; -- (NSString* _Nonnull)sendMessage:(id _Nullable)callback message:(NSString* _Nullable)message receiver:(NSString* _Nullable)receiver groupID:(NSString* _Nullable)groupID onlineUserOnly:(BOOL)onlineUserOnly; -- (NSString* _Nonnull)sendMessageNotOss:(id _Nullable)callback message:(NSString* _Nullable)message receiver:(NSString* _Nullable)receiver groupID:(NSString* _Nullable)groupID onlineUserOnly:(BOOL)onlineUserOnly; -- (void)setConversationDraft:(NSString* _Nullable)conversationID draftText:(NSString* _Nullable)draftText callback:(id _Nullable)callback; -- (void)setConversationListener:(id _Nullable)listener; -- (void)setConversationRecvMessageOpt:(id _Nullable)callback conversationIDList:(NSString* _Nullable)conversationIDList opt:(long)opt; -- (void)setFriendInfo:(NSString* _Nullable)comment callback:(id _Nullable)callback; -- (BOOL)setFriendListener:(id _Nullable)listener; -- (void)setGroupInfo:(NSString* _Nullable)jsonGroupInfo callback:(id _Nullable)callback; -- (void)setGroupListener:(id _Nullable)callback; -- (void)setMinSeqSvr:(int64_t)minSeqSvr; -- (void)setSelfInfo:(NSString* _Nullable)info cb:(id _Nullable)cb; -- (void)transferGroupOwner:(NSString* _Nullable)groupId userId:(NSString* _Nullable)userId callback:(id _Nullable)callback; -- (void)typingStatusUpdate:(NSString* _Nullable)receiver msgTip:(NSString* _Nullable)msgTip; -- (void)unInitSDK; -// skipped method UserRelated.WriteMsg with unsupported parameter or return types - -@end - -@interface Open_im_sdkUserSendMsgReq : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -// skipped field UserSendMsgReq.Options with unsupported type: map[string]int32 - -@property (nonatomic) NSString* _Nonnull senderNickName; -@property (nonatomic) NSString* _Nonnull senderFaceURL; -@property (nonatomic) int32_t platformID; -@property (nonatomic) int32_t sessionType; -@property (nonatomic) int32_t msgFrom; -@property (nonatomic) int32_t contentType; -@property (nonatomic) NSString* _Nonnull recvID; -// skipped field UserSendMsgReq.ForceList with unsupported type: []string - -@property (nonatomic) NSString* _Nonnull content; -@property (nonatomic) NSString* _Nonnull clientMsgID; -// skipped field UserSendMsgReq.XXX_NoUnkeyedLiteral with unsupported type: struct{} - -@property (nonatomic) NSData* _Nullable xxX_unrecognized; -@property (nonatomic) int32_t xxX_sizecache; -// skipped method UserSendMsgReq.Descriptor with unsupported parameter or return types - -- (void)protoMessage; -- (void)reset; -- (NSString* _Nonnull)string; -- (void)xxX_DiscardUnknown; -- (NSData* _Nullable)xxX_Marshal:(NSData* _Nullable)b deterministic:(BOOL)deterministic error:(NSError* _Nullable* _Nullable)error; -// skipped method UserSendMsgReq.XXX_Merge with unsupported parameter or return types - -- (long)xxX_Size; -- (BOOL)xxX_Unmarshal:(NSData* _Nullable)b error:(NSError* _Nullable* _Nullable)error; -@end - -@interface Open_im_sdkUserSendMsgResp : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) NSString* _Nonnull serverMsgID; -@property (nonatomic) NSString* _Nonnull clientMsgID; -@property (nonatomic) int64_t sendTime; -// skipped field UserSendMsgResp.XXX_NoUnkeyedLiteral with unsupported type: struct{} - -@property (nonatomic) NSData* _Nullable xxX_unrecognized; -@property (nonatomic) int32_t xxX_sizecache; -// skipped method UserSendMsgResp.Descriptor with unsupported parameter or return types - -- (void)protoMessage; -- (void)reset; -- (NSString* _Nonnull)string; -- (void)xxX_DiscardUnknown; -- (NSData* _Nullable)xxX_Marshal:(NSData* _Nullable)b deterministic:(BOOL)deterministic error:(NSError* _Nullable* _Nullable)error; -// skipped method UserSendMsgResp.XXX_Merge with unsupported parameter or return types - -- (long)xxX_Size; -- (BOOL)xxX_Unmarshal:(NSData* _Nullable)b error:(NSError* _Nullable* _Nullable)error; -@end - -@interface Open_im_sdkVideoBaseInfo : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) NSString* _Nonnull videoPath; -@property (nonatomic) NSString* _Nonnull videoUUID; -@property (nonatomic) NSString* _Nonnull videoURL; -@property (nonatomic) NSString* _Nonnull videoType; -@property (nonatomic) int64_t videoSize; -@property (nonatomic) int64_t duration; -@property (nonatomic) NSString* _Nonnull snapshotPath; -@property (nonatomic) NSString* _Nonnull snapshotUUID; -@property (nonatomic) int64_t snapshotSize; -@property (nonatomic) NSString* _Nonnull snapshotURL; -@property (nonatomic) int32_t snapshotWidth; -@property (nonatomic) int32_t snapshotHeight; -@end - -@interface Open_im_sdkWsMsgData : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) int32_t platformID; -@property (nonatomic) int32_t sessionType; -@property (nonatomic) int32_t msgFrom; -@property (nonatomic) int32_t contentType; -@property (nonatomic) NSString* _Nonnull recvID; -// skipped field WsMsgData.ForceList with unsupported type: []string - -@property (nonatomic) NSString* _Nonnull content; -// skipped field WsMsgData.Options with unsupported type: map[string]interface{} - -@property (nonatomic) NSString* _Nonnull clientMsgID; -// skipped field WsMsgData.OfflineInfo with unsupported type: map[string]interface{} - -// skipped field WsMsgData.Ext with unsupported type: map[string]interface{} - -@end - -@interface Open_im_sdkWsSendMsgResp : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) NSString* _Nonnull serverMsgID; -@property (nonatomic) NSString* _Nonnull clientMsgID; -@property (nonatomic) int64_t sendTime; -@end - -@interface Open_im_sdkWsSubMsg : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (nonnull instancetype)init; -@property (nonatomic) int64_t sendTime; -@property (nonatomic) NSString* _Nonnull serverMsgID; -@property (nonatomic) NSString* _Nonnull clientMsgID; -@end - -FOUNDATION_EXPORT const int64_t Open_im_sdkAcceptFriendApplicationTip; -FOUNDATION_EXPORT const int64_t Open_im_sdkAcceptGroupApplicationTip; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkAcceptGroupTip; -FOUNDATION_EXPORT const int64_t Open_im_sdkAddConOrUpLatMsg; -FOUNDATION_EXPORT const int64_t Open_im_sdkAddFriendTip; -FOUNDATION_EXPORT const int64_t Open_im_sdkAtText; -FOUNDATION_EXPORT const int64_t Open_im_sdkCard; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdAcceptFriend; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdAddFriend; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdBlackList; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdDeleteConversation; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdForceSyncFriend; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdForceSyncFriendApplication; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdForceSyncLoginUerInfo; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdForceSyncMsg; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdFriend; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdFriendApplication; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdFroceSyncBlackList; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdGeyLoginUserInfo; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdNewMsgCome; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdReLogin; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdRefuseFriend; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdUnInit; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkCmdUpdateConversation; -FOUNDATION_EXPORT const int64_t Open_im_sdkCreateGroupTip; -FOUNDATION_EXPORT const int64_t Open_im_sdkCustom; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkDeFaultSuccessMsg; -FOUNDATION_EXPORT const int64_t Open_im_sdkErrCodeConversation; -FOUNDATION_EXPORT const int64_t Open_im_sdkErrCodeFriend; -FOUNDATION_EXPORT const int64_t Open_im_sdkErrCodeGroup; -FOUNDATION_EXPORT const int64_t Open_im_sdkErrCodeInitLogin; -FOUNDATION_EXPORT const int64_t Open_im_sdkErrCodeUserInfo; -FOUNDATION_EXPORT const int64_t Open_im_sdkFile; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkFriendAcceptTip; -FOUNDATION_EXPORT const int64_t Open_im_sdkGroupActionAcceptGroupApplication; -FOUNDATION_EXPORT const int64_t Open_im_sdkGroupActionApplyJoinGroup; -FOUNDATION_EXPORT const int64_t Open_im_sdkGroupActionCreateGroup; -FOUNDATION_EXPORT const int64_t Open_im_sdkGroupActionInviteUserToGroup; -FOUNDATION_EXPORT const int64_t Open_im_sdkGroupActionKickGroupMember; -FOUNDATION_EXPORT const int64_t Open_im_sdkGroupActionQuitGroup; -FOUNDATION_EXPORT const int64_t Open_im_sdkGroupActionRefuseGroupApplication; -FOUNDATION_EXPORT const int64_t Open_im_sdkGroupActionSetGroupInfo; -FOUNDATION_EXPORT const int64_t Open_im_sdkGroupActionTransferGroupOwner; -FOUNDATION_EXPORT const int64_t Open_im_sdkGroupChatType; -/** - * /////////////////////////////////////// - */ -FOUNDATION_EXPORT const int64_t Open_im_sdkGroupTipBegin; -FOUNDATION_EXPORT const int64_t Open_im_sdkGroupTipEnd; -FOUNDATION_EXPORT const int64_t Open_im_sdkHasRead; -FOUNDATION_EXPORT const int64_t Open_im_sdkHasReadReceipt; -FOUNDATION_EXPORT const int64_t Open_im_sdkIncrUnread; -FOUNDATION_EXPORT const int64_t Open_im_sdkInviteUserToGroupTip; -FOUNDATION_EXPORT const int64_t Open_im_sdkJoinGroupTip; -FOUNDATION_EXPORT const int64_t Open_im_sdkKickGroupMemberTip; -FOUNDATION_EXPORT const int64_t Open_im_sdkLocation; -FOUNDATION_EXPORT const int64_t Open_im_sdkLoginFailed; -FOUNDATION_EXPORT const int64_t Open_im_sdkLoginSuccess; -FOUNDATION_EXPORT const int64_t Open_im_sdkLogining; -FOUNDATION_EXPORT const int64_t Open_im_sdkLogoutCmd; -FOUNDATION_EXPORT const int64_t Open_im_sdkMaxTotalMsgLen; -FOUNDATION_EXPORT const int64_t Open_im_sdkMerger; -FOUNDATION_EXPORT const int64_t Open_im_sdkMsgStatusHasDeleted; -FOUNDATION_EXPORT const int64_t Open_im_sdkMsgStatusRevoked; -FOUNDATION_EXPORT const int64_t Open_im_sdkMsgStatusSendFailed; -FOUNDATION_EXPORT const int64_t Open_im_sdkMsgStatusSendSuccess; -/** - * MsgStatus - */ -FOUNDATION_EXPORT const int64_t Open_im_sdkMsgStatusSending; -FOUNDATION_EXPORT const int64_t Open_im_sdkNewCon; -FOUNDATION_EXPORT const int64_t Open_im_sdkNewConChange; -FOUNDATION_EXPORT const int64_t Open_im_sdkNotPinned; -FOUNDATION_EXPORT const int64_t Open_im_sdkNotRead; -FOUNDATION_EXPORT const int64_t Open_im_sdkNotReceiveMessage; -FOUNDATION_EXPORT const int64_t Open_im_sdkPicture; -FOUNDATION_EXPORT const int64_t Open_im_sdkPinned; -FOUNDATION_EXPORT const int64_t Open_im_sdkQuitGroupTip; -FOUNDATION_EXPORT const int64_t Open_im_sdkQuote; -/** - * MsgReceiveOpt - */ -FOUNDATION_EXPORT const int64_t Open_im_sdkReceiveMessage; -FOUNDATION_EXPORT const int64_t Open_im_sdkReceiveNotNotifyMessage; -FOUNDATION_EXPORT const int64_t Open_im_sdkRefuseFriendApplicationTip; -FOUNDATION_EXPORT const int64_t Open_im_sdkRefuseGroupApplicationTip; -FOUNDATION_EXPORT const int64_t Open_im_sdkRevoke; -FOUNDATION_EXPORT const int64_t Open_im_sdkSdkInit; -FOUNDATION_EXPORT const int64_t Open_im_sdkSetGroupInfoTip; -FOUNDATION_EXPORT const int64_t Open_im_sdkSetSelfInfoTip; -/** - * /////////////////////////////////// -SessionType - */ -FOUNDATION_EXPORT const int64_t Open_im_sdkSingleChatType; -/** - * //////////////////////////////////////// - */ -FOUNDATION_EXPORT const int64_t Open_im_sdkSingleTipBegin; -FOUNDATION_EXPORT const int64_t Open_im_sdkSingleTipEnd; -FOUNDATION_EXPORT const int64_t Open_im_sdkSysMsgType; -/** - * ContentType - */ -FOUNDATION_EXPORT const int64_t Open_im_sdkText; -FOUNDATION_EXPORT const int64_t Open_im_sdkTimeOffset; -FOUNDATION_EXPORT const int64_t Open_im_sdkTokenFailedExpired; -FOUNDATION_EXPORT const int64_t Open_im_sdkTokenFailedInvalid; -FOUNDATION_EXPORT const int64_t Open_im_sdkTokenFailedKickedOffline; -FOUNDATION_EXPORT const int64_t Open_im_sdkTotalUnreadMessageChanged; -FOUNDATION_EXPORT const int64_t Open_im_sdkTransferGroupOwnerTip; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkTransferGroupTip; -FOUNDATION_EXPORT const int64_t Open_im_sdkTyping; -FOUNDATION_EXPORT const int64_t Open_im_sdkUnreadCountSetZero; -FOUNDATION_EXPORT const int64_t Open_im_sdkUpdateFaceUrlAndNickName; -FOUNDATION_EXPORT const int64_t Open_im_sdkUpdateLatestMessageChange; -/** - * ////////////////////////////////////// -MsgFrom - */ -FOUNDATION_EXPORT const int64_t Open_im_sdkUserMsgType; -FOUNDATION_EXPORT const int64_t Open_im_sdkVideo; -FOUNDATION_EXPORT const int64_t Open_im_sdkVoice; -FOUNDATION_EXPORT const int64_t Open_im_sdkWSDataError; -FOUNDATION_EXPORT const int64_t Open_im_sdkWSGetNewestSeq; -FOUNDATION_EXPORT const int64_t Open_im_sdkWSKickOnlineMsg; -FOUNDATION_EXPORT const int64_t Open_im_sdkWSPullMsg; -FOUNDATION_EXPORT const int64_t Open_im_sdkWSPullMsgBySeqList; -FOUNDATION_EXPORT const int64_t Open_im_sdkWSPushMsg; -FOUNDATION_EXPORT const int64_t Open_im_sdkWSSendMsg; -FOUNDATION_EXPORT NSString* _Nonnull const Open_im_sdkZoomScale; +#include "Open_im_sdk_callback.objc.h" @interface Open_im_sdk : NSObject -+ (int32_t) sdkLogFlag; -+ (void) setSdkLogFlag:(int32_t)v; - -// skipped variable SvrConf with unsupported type: open_im_sdk/open_im_sdk.IMConfig - -// skipped variable UserRouterMap with unsupported type: map[string]*open_im_sdk/open_im_sdk.UserRelated +// skipped variable UserRouterMap with unsupported type: map[string]*open_im_sdk/internal/login.LoginMgr // skipped variable UserSDKRwLock with unsupported type: sync.RWMutex @end -FOUNDATION_EXPORT void Open_im_sdkAcceptFriendApplication(id _Nullable callback, NSString* _Nullable uid); - -FOUNDATION_EXPORT void Open_im_sdkAcceptGroupApplication(NSString* _Nullable application, NSString* _Nullable reason, id _Nullable callback); - -FOUNDATION_EXPORT void Open_im_sdkAddAdvancedMsgListener(id _Nullable listener); - -FOUNDATION_EXPORT void Open_im_sdkAddFriend(id _Nullable callback, NSString* _Nullable paramsReq); - -FOUNDATION_EXPORT void Open_im_sdkAddToBlackList(id _Nullable callback, NSString* _Nullable blackUid); - -FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id _Nullable callback, NSString* _Nullable uidList); - -/** - * func (u *UserRelated) pullOldMsgAndMergeNewMsgByWs(beginSeq int64, endSeq int64) (err error) { - LogBegin(beginSeq, endSeq) - if beginSeq > endSeq { - LogSReturn(nil) - return nil - } - LogBegin("AddCh") - msgIncr, ch := u.AddCh() - - var wsReq GeneralWsReq - wsReq.ReqIdentifier = WSPullMsgBySeqList - wsReq.OperationID = operationIDGenerator() - wsReq.SendID = u.LoginUid - //wsReq.Token = u.token - wsReq.MsgIncr = msgIncr - - var pullMsgReq PullMessageBySeqListReq - LogBegin("getNoInSeq ", beginSeq, endSeq) - pullMsgReq.SeqList = u.getNotInSeq(beginSeq, endSeq) - LogEnd("getNoInSeq ", pullMsgReq.SeqList) - - wsReq.Data, err = proto.Marshal(&pullMsgReq) - if err != nil { - sdkLog("Marshl failed ") - LogFReturn(err.Error()) - u.DelCh(msgIncr) - return err - } - LogBegin("WriteMsg ", wsReq.OperationID) - err, _ = u.WriteMsg(wsReq) - LogEnd("WriteMsg ", wsReq.OperationID, err) - if err != nil { - sdkLog("close conn, WriteMsg failed ", err.Error()) - u.DelCh(msgIncr) - return err - } - - timeout := 10 - select { - case r := <-ch: - sdkLog("ws ch recvMsg success: ", wsReq.OperationID) - if r.ErrCode != 0 { - sdkLog("pull msg failed ", r.ErrCode, r.ErrMsg, wsReq.OperationID) - u.DelCh(msgIncr) - return errors.New(r.ErrMsg) - } else { - sdkLog("pull msg success ", wsReq.OperationID) - var pullMsg PullUserMsgResp - - pullMsg.ErrCode = 0 - - var pullMsgResp PullMessageBySeqListResp - err := proto.Unmarshal(r.Data, &pullMsgResp) - if err != nil { - sdkLog("Unmarshal failed ", err.Error()) - LogFReturn(err.Error()) - return err - } - pullMsg.Data.Group = pullMsgResp.GroupUserMsg - pullMsg.Data.Single = pullMsgResp.SingleUserMsg - pullMsg.Data.MaxSeq = pullMsgResp.MaxSeq - pullMsg.Data.MinSeq = pullMsgResp.MinSeq - - u.seqMsgMutex.Lock() - - arrMsg := ArrMsg{} - isInmap := false - for i := 0; i < len(pullMsg.Data.Single); i++ { - for j := 0; j < len(pullMsg.Data.Single[i].List); j++ { - sdkLog("open_im pull one msg: |", pullMsg.Data.Single[i].List[j].ClientMsgID, "|") - singleMsg := MsgData{ - SendID: pullMsg.Data.Single[i].List[j].SendID, - RecvID: pullMsg.Data.Single[i].List[j].RecvID, - SessionType: SingleChatType, - MsgFrom: pullMsg.Data.Single[i].List[j].MsgFrom, - ContentType: pullMsg.Data.Single[i].List[j].ContentType, - ServerMsgID: pullMsg.Data.Single[i].List[j].ServerMsgID, - Content: pullMsg.Data.Single[i].List[j].Content, - SendTime: pullMsg.Data.Single[i].List[j].SendTime, - Seq: pullMsg.Data.Single[i].List[j].Seq, - SenderNickName: pullMsg.Data.Single[i].List[j].SenderNickName, - SenderFaceURL: pullMsg.Data.Single[i].List[j].SenderFaceURL, - ClientMsgID: pullMsg.Data.Single[i].List[j].ClientMsgID, - SenderPlatformID: pullMsg.Data.Single[i].List[j].SenderPlatformID, - } - // arrMsg.SingleData = append(arrMsg.SingleData, singleMsg) - u.seqMsg[pullMsg.Data.Single[i].List[j].Seq] = singleMsg - sdkLog("into map, seq: ", pullMsg.Data.Single[i].List[j].Seq, pullMsg.Data.Single[i].List[j].ClientMsgID, pullMsg.Data.Single[i].List[j].ServerMsgID) - } - } - - for i := 0; i < len(pullMsg.Data.Group); i++ { - for j := 0; j < len(pullMsg.Data.Group[i].List); j++ { - groupMsg := MsgData{ - SendID: pullMsg.Data.Group[i].List[j].SendID, - RecvID: pullMsg.Data.Group[i].List[j].RecvID, - SessionType: GroupChatType, - MsgFrom: pullMsg.Data.Group[i].List[j].MsgFrom, - ContentType: pullMsg.Data.Group[i].List[j].ContentType, - ServerMsgID: pullMsg.Data.Group[i].List[j].ServerMsgID, - Content: pullMsg.Data.Group[i].List[j].Content, - SendTime: pullMsg.Data.Group[i].List[j].SendTime, - Seq: pullMsg.Data.Group[i].List[j].Seq, - SenderNickName: pullMsg.Data.Group[i].List[j].SenderNickName, - SenderFaceURL: pullMsg.Data.Group[i].List[j].SenderFaceURL, - ClientMsgID: pullMsg.Data.Group[i].List[j].ClientMsgID, - SenderPlatformID: pullMsg.Data.Group[i].List[j].SenderPlatformID, - } - // arrMsg.GroupData = append(arrMsg.GroupData, groupMsg) - u.seqMsg[pullMsg.Data.Group[i].List[j].Seq] = groupMsg - sdkLog("into map, seq: ", pullMsg.Data.Group[i].List[j].Seq, pullMsg.Data.Group[i].List[j].ClientMsgID, pullMsg.Data.Group[i].List[j].ServerMsgID) - } - } - u.seqMsgMutex.Unlock() - - u.seqMsgMutex.RLock() - for i := beginSeq; i <= endSeq; i++ { - v, ok := u.seqMsg[i] - if ok { - if v.SessionType == SingleChatType { - arrMsg.SingleData = append(arrMsg.SingleData, v) - sdkLog("pull seq: ", v.Seq, v) - if v.ContentType > SingleTipBegin && v.ContentType < SingleTipEnd { - var msgRecv MsgData - msgRecv.ContentType = v.ContentType - msgRecv.Content = v.Content - msgRecv.SendID = v.SendID - msgRecv.RecvID = v.RecvID - LogBegin("doFriendMsg ", msgRecv) - u.doFriendMsg(msgRecv) - LogEnd("doFriendMsg ", msgRecv) - } - } else if v.SessionType == GroupChatType { - sdkLog("pull seq: ", v.Seq, v) - arrMsg.GroupData = append(arrMsg.GroupData, v) - if v.ContentType > GroupTipBegin && v.ContentType < GroupTipEnd { - LogBegin("doGroupMsg ", v) - u.doGroupMsg(v) - LogEnd("doGroupMsg ", v) - } - } else { - sdkLog("type failed, ", v.SessionType, v) - } - } else { - sdkLog("seq no in map, failed, seq: ", i) - } - } - u.seqMsgMutex.RUnlock() - - sdkLog("triggerCmdNewMsgCome len: ", len(arrMsg.SingleData), len(arrMsg.GroupData)) - err = u.triggerCmdNewMsgCome(arrMsg) - if err != nil { - sdkLog("triggerCmdNewMsgCome failed, ", err.Error()) - } - u.DelCh(msgIncr) - } - case <-time.After(time.Second * time.Duration(timeout)): - sdkLog("ws ch recvMsg timeout,", wsReq.OperationID) - u.DelCh(msgIncr) - } - return nil -} - */ -FOUNDATION_EXPORT long Open_im_sdkCheckToken(NSString* _Nullable uId, NSString* _Nullable token); - -FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id _Nullable callback, NSString* _Nullable userID); +FOUNDATION_EXPORT void Open_im_sdkAcceptFriendApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg); -FOUNDATION_EXPORT void Open_im_sdkClearGroupHistoryMessage(id _Nullable callback, NSString* _Nullable groupID); +FOUNDATION_EXPORT void Open_im_sdkAcceptGroupApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nullable cardInfo); +FOUNDATION_EXPORT void Open_im_sdkAddBlack(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable blackUserID); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description); +FOUNDATION_EXPORT void Open_im_sdkAddFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDReqMsg); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable filePath, NSString* _Nullable fileName); +FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable fileBaseInfo); +FOUNDATION_EXPORT BOOL Open_im_sdkCheckToken(NSString* _Nullable userID, NSString* _Nullable token, NSError* _Nullable* _Nullable error); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageFromFullPath(NSString* _Nullable fileFullPath, NSString* _Nullable fileName); +FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateForwardMessage(NSString* _Nullable m); +FOUNDATION_EXPORT void Open_im_sdkClearGroupHistoryMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); -FOUNDATION_EXPORT void Open_im_sdkCreateGroup(NSString* _Nullable gInfo, NSString* _Nullable memberList, id _Nullable callback); +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nullable operationID, NSString* _Nullable cardInfo); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessage(NSString* _Nullable imagePath); +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable operationID, NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageByURL(NSString* _Nullable sourcePicture, NSString* _Nullable bigPicture, NSString* _Nullable snapshotPicture); +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable fileName); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageFromFullPath(NSString* _Nullable imageFullPath); +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable operationID, NSString* _Nullable fileBaseInfo); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateLocationMessage(NSString* _Nullable description, double longitude, double latitude); +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable fileFullPath, NSString* _Nullable fileName); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateMergerMessage(NSString* _Nullable messageList, NSString* _Nullable title, NSString* _Nullable summaryList); +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateForwardMessage(NSString* _Nullable operationID, NSString* _Nullable m); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateQuoteMessage(NSString* _Nullable text, NSString* _Nullable message); +FOUNDATION_EXPORT void Open_im_sdkCreateGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupBaseInfo, NSString* _Nullable memberList); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessage(NSString* _Nullable soundPath, int64_t duration); +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessage(NSString* _Nullable operationID, NSString* _Nullable imagePath); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageByURL(NSString* _Nullable soundBaseInfo); +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageByURL(NSString* _Nullable operationID, NSString* _Nullable sourcePicture, NSString* _Nullable bigPicture, NSString* _Nullable snapshotPicture); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageFromFullPath(NSString* _Nullable soundPath, int64_t duration); +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable imageFullPath); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextAtMessage(NSString* _Nullable text, NSString* _Nullable atUserList); +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateLocationMessage(NSString* _Nullable operationID, NSString* _Nullable description, double longitude, double latitude); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextMessage(NSString* _Nullable text); +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateMergerMessage(NSString* _Nullable operationID, NSString* _Nullable messageList, NSString* _Nullable title, NSString* _Nullable summaryList); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessage(NSString* _Nullable videoPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotPath); +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateQuoteMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable message); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageByURL(NSString* _Nullable videoBaseInfo); +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessage(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageFromFullPath(NSString* _Nullable videoFullPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotFullPath); +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageByURL(NSString* _Nullable operationID, NSString* _Nullable soundBaseInfo); -// skipped function Debug with unsupported parameter or return types +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration); +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextAtMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable atUserList); -// skipped function DebugByKv with unsupported parameter or return types +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextMessage(NSString* _Nullable operationID, NSString* _Nullable text); +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessage(NSString* _Nullable operationID, NSString* _Nullable videoPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotPath); -FOUNDATION_EXPORT void Open_im_sdkDeleteConversation(NSString* _Nullable conversationID, id _Nullable callback); +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageByURL(NSString* _Nullable operationID, NSString* _Nullable videoBaseInfo); -FOUNDATION_EXPORT void Open_im_sdkDeleteFromBlackList(id _Nullable callback, NSString* _Nullable deleteUid); +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable videoFullPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotFullPath); -FOUNDATION_EXPORT void Open_im_sdkDeleteFromFriendList(NSString* _Nullable deleteUid, id _Nullable callback); +FOUNDATION_EXPORT void Open_im_sdkDeleteConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID); -FOUNDATION_EXPORT void Open_im_sdkDeleteMessageFromLocalStorage(id _Nullable callback, NSString* _Nullable message); +FOUNDATION_EXPORT void Open_im_sdkDeleteFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable friendUserID); -// skipped function Error with unsupported parameter or return types +FOUNDATION_EXPORT void Open_im_sdkDeleteMessageFromLocalStorage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message); +FOUNDATION_EXPORT void Open_im_sdkGetAllConversationList(id _Nullable callback, NSString* _Nullable operationID); -// skipped function ErrorByArgs with unsupported parameter or return types - - -// skipped function ErrorByKv with unsupported parameter or return types - - -FOUNDATION_EXPORT void Open_im_sdkFindMessages(id _Nullable callback, NSString* _Nullable messageIDList); - -FOUNDATION_EXPORT void Open_im_sdkForceSyncLoginUerInfo(void); - -FOUNDATION_EXPORT BOOL Open_im_sdkForceSyncMsg(void); - -FOUNDATION_EXPORT void Open_im_sdkGetAllConversationList(id _Nullable callback); - -FOUNDATION_EXPORT void Open_im_sdkGetBlackList(id _Nullable callback); +FOUNDATION_EXPORT void Open_im_sdkGetBlackList(id _Nullable callback, NSString* _Nullable operationID); FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetConversationIDBySessionType(NSString* _Nullable sourceID, long sessionType); -FOUNDATION_EXPORT void Open_im_sdkGetConversationListSplit(id _Nullable callback, long offset, long count); - -FOUNDATION_EXPORT void Open_im_sdkGetConversationRecvMessageOpt(id _Nullable callback, NSString* _Nullable conversationIDList); - -/** - * Get the current timestamp by Mill - */ -FOUNDATION_EXPORT int64_t Open_im_sdkGetCurrentTimestampByMill(void); - -FOUNDATION_EXPORT void Open_im_sdkGetFriendApplicationList(id _Nullable callback); +FOUNDATION_EXPORT void Open_im_sdkGetConversationListSplit(id _Nullable callback, NSString* _Nullable operationID, long offset, long count); -FOUNDATION_EXPORT void Open_im_sdkGetFriendList(id _Nullable callback); +FOUNDATION_EXPORT void Open_im_sdkGetConversationRecvMessageOpt(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList); -FOUNDATION_EXPORT void Open_im_sdkGetFriendsInfo(id _Nullable callback, NSString* _Nullable uidList); +FOUNDATION_EXPORT void Open_im_sdkGetDesignatedFriendsInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); -FOUNDATION_EXPORT void Open_im_sdkGetGroupApplicationList(id _Nullable callback); +FOUNDATION_EXPORT void Open_im_sdkGetFriendList(id _Nullable callback, NSString* _Nullable operationID); -FOUNDATION_EXPORT void Open_im_sdkGetGroupMemberList(NSString* _Nullable groupId, int32_t filter, int32_t next, id _Nullable callback); +FOUNDATION_EXPORT void Open_im_sdkGetGroupMemberList(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, int32_t filter, int32_t offset, int32_t count); -FOUNDATION_EXPORT void Open_im_sdkGetGroupMembersInfo(NSString* _Nullable groupId, NSString* _Nullable userList, id _Nullable callback); +FOUNDATION_EXPORT void Open_im_sdkGetGroupMembersInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable userIDList); -FOUNDATION_EXPORT void Open_im_sdkGetGroupsInfo(NSString* _Nullable groupIdList, id _Nullable callback); +FOUNDATION_EXPORT void Open_im_sdkGetGroupsInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupIDList); -FOUNDATION_EXPORT void Open_im_sdkGetHistoryMessageList(id _Nullable callback, NSString* _Nullable getMessageOptions); +FOUNDATION_EXPORT void Open_im_sdkGetHistoryMessageList(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable getMessageOptions); -FOUNDATION_EXPORT void Open_im_sdkGetJoinedGroupList(id _Nullable callback); +FOUNDATION_EXPORT void Open_im_sdkGetJoinedGroupList(id _Nullable callback, NSString* _Nullable operationID); -FOUNDATION_EXPORT long Open_im_sdkGetLoginStatus(void); +FOUNDATION_EXPORT int32_t Open_im_sdkGetLoginStatus(void); FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetLoginUser(void); -FOUNDATION_EXPORT void Open_im_sdkGetMultipleConversation(NSString* _Nullable conversationIDList, id _Nullable callback); - -FOUNDATION_EXPORT void Open_im_sdkGetOneConversation(NSString* _Nullable sourceID, long sessionType, id _Nullable callback); - -FOUNDATION_EXPORT void Open_im_sdkGetTotalUnreadMsgCount(id _Nullable callback); - -FOUNDATION_EXPORT Open_im_sdkUserRelated* _Nullable Open_im_sdkGetUserWorker(NSString* _Nullable uid); - -FOUNDATION_EXPORT void Open_im_sdkGetUsersInfo(NSString* _Nullable uIDList, id _Nullable cb); - -// skipped function Info with unsupported parameter or return types - - -// skipped function InfoByArgs with unsupported parameter or return types - - -// skipped function InfoByKv with unsupported parameter or return types - - -FOUNDATION_EXPORT BOOL Open_im_sdkInitOnce(Open_im_sdkIMConfig* _Nullable config); - -FOUNDATION_EXPORT BOOL Open_im_sdkInitSDK(NSString* _Nullable config, id _Nullable cb); - -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkInsertSingleMessageToLocalStorage(id _Nullable callback, NSString* _Nullable message, NSString* _Nullable userID, NSString* _Nullable sender); - -FOUNDATION_EXPORT void Open_im_sdkInviteUserToGroup(NSString* _Nullable groupId, NSString* _Nullable reason, NSString* _Nullable userList, id _Nullable callback); - -FOUNDATION_EXPORT BOOL Open_im_sdkIsNil(void); - -FOUNDATION_EXPORT void Open_im_sdkJoinGroup(NSString* _Nullable groupId, NSString* _Nullable message, id _Nullable callback); - -FOUNDATION_EXPORT void Open_im_sdkKickGroupMember(NSString* _Nullable groupId, NSString* _Nullable reason, NSString* _Nullable userList, id _Nullable callback); - -// skipped function LogBegin with unsupported parameter or return types +FOUNDATION_EXPORT void Open_im_sdkGetMultipleConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList); +FOUNDATION_EXPORT void Open_im_sdkGetOneConversation(id _Nullable callback, NSString* _Nullable operationID, long sessionType, NSString* _Nullable sourceID); -// skipped function LogEnd with unsupported parameter or return types +FOUNDATION_EXPORT void Open_im_sdkGetRecvFriendApplicationList(id _Nullable callback, NSString* _Nullable operationID); +FOUNDATION_EXPORT void Open_im_sdkGetRecvGroupApplicationList(id _Nullable callback, NSString* _Nullable operationID); -// skipped function LogFReturn with unsupported parameter or return types +FOUNDATION_EXPORT void Open_im_sdkGetSelfUserInfo(id _Nullable callback, NSString* _Nullable operationID); +FOUNDATION_EXPORT void Open_im_sdkGetSendFriendApplicationList(id _Nullable callback, NSString* _Nullable operationID); -// skipped function LogSReturn with unsupported parameter or return types +FOUNDATION_EXPORT void Open_im_sdkGetSendGroupApplicationList(id _Nullable callback, NSString* _Nullable operationID); +FOUNDATION_EXPORT void Open_im_sdkGetTotalUnreadMsgCount(id _Nullable callback, NSString* _Nullable operationID); -// skipped function LogStart with unsupported parameter or return types +// skipped function GetUserWorker with unsupported parameter or return types -FOUNDATION_EXPORT void Open_im_sdkLogin(NSString* _Nullable uid, NSString* _Nullable tk, id _Nullable callback); - -FOUNDATION_EXPORT void Open_im_sdkLogout(id _Nullable callback); - -FOUNDATION_EXPORT void Open_im_sdkMarkC2CMessageAsRead(id _Nullable callback, NSString* _Nullable receiver, NSString* _Nullable msgIDList); - -FOUNDATION_EXPORT void Open_im_sdkMarkGroupMessageHasRead(id _Nullable callback, NSString* _Nullable groupID); - /** - * Deprecated + * /////////////////////user///////////////////// */ -FOUNDATION_EXPORT void Open_im_sdkMarkSingleMessageHasRead(id _Nullable callback, NSString* _Nullable userID); +FOUNDATION_EXPORT void Open_im_sdkGetUsersInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkMd5(NSString* _Nullable s); +// skipped function InitOnce with unsupported parameter or return types -// skipped function NewDebug with unsupported parameter or return types +FOUNDATION_EXPORT BOOL Open_im_sdkInitSDK(id _Nullable listener, NSString* _Nullable operationID, NSString* _Nullable config); -// skipped function NewError with unsupported parameter or return types +FOUNDATION_EXPORT void Open_im_sdkInsertSingleMessageToLocalStorage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable sendID); +FOUNDATION_EXPORT void Open_im_sdkInviteUserToGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList); -// skipped function NewInfo with unsupported parameter or return types +FOUNDATION_EXPORT void Open_im_sdkJoinGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reqMsg); +FOUNDATION_EXPORT void Open_im_sdkKickGroupMember(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList); -// skipped function NewLfsHook with unsupported parameter or return types +FOUNDATION_EXPORT void Open_im_sdkLogin(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable token); +FOUNDATION_EXPORT void Open_im_sdkLogout(id _Nullable callback, NSString* _Nullable operationID); -/** - * func init() { - logger = loggerInit("") +FOUNDATION_EXPORT void Open_im_sdkMarkC2CMessageAsRead(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable msgIDList); -} - */ -FOUNDATION_EXPORT void Open_im_sdkNewPrivateLog(NSString* _Nullable moduleName); +FOUNDATION_EXPORT void Open_im_sdkMarkGroupMessageHasRead(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); -// skipped function NewWarn with unsupported parameter or return types +FOUNDATION_EXPORT void Open_im_sdkPinConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, BOOL isPinned); +FOUNDATION_EXPORT void Open_im_sdkQuitGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); -FOUNDATION_EXPORT void Open_im_sdkPinConversation(NSString* _Nullable conversationID, BOOL isPinned, id _Nullable callback); +FOUNDATION_EXPORT void Open_im_sdkRefuseFriendApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg); -// skipped function Post2Api with unsupported parameter or return types +FOUNDATION_EXPORT void Open_im_sdkRefuseGroupApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg); +FOUNDATION_EXPORT void Open_im_sdkRemoveBlack(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable removeUserID); -FOUNDATION_EXPORT void Open_im_sdkQuitGroup(NSString* _Nullable groupId, id _Nullable callback); - -FOUNDATION_EXPORT void Open_im_sdkRefuseFriendApplication(id _Nullable callback, NSString* _Nullable uid); - -FOUNDATION_EXPORT void Open_im_sdkRefuseGroupApplication(NSString* _Nullable application, NSString* _Nullable reason, id _Nullable callback); - -FOUNDATION_EXPORT void Open_im_sdkRevokeMessage(id _Nullable callback, NSString* _Nullable message); - -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkRunFuncName(void); +FOUNDATION_EXPORT void Open_im_sdkRevokeMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message); FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSdkVersion(void); -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSendMessage(id _Nullable callback, NSString* _Nullable message, NSString* _Nullable receiver, NSString* _Nullable groupID, BOOL onlineUserOnly); - -FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSendMessageNotOss(id _Nullable callback, NSString* _Nullable message, NSString* _Nullable receiver, NSString* _Nullable groupID, BOOL onlineUserOnly); +FOUNDATION_EXPORT void Open_im_sdkSendMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo); -FOUNDATION_EXPORT void Open_im_sdkSetConversationDraft(NSString* _Nullable conversationID, NSString* _Nullable draftText, id _Nullable callback); +FOUNDATION_EXPORT void Open_im_sdkSendMessageNotOss(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo); -FOUNDATION_EXPORT void Open_im_sdkSetConversationListener(id _Nullable listener); +FOUNDATION_EXPORT void Open_im_sdkSetAdvancedMsgListener(id _Nullable listener); -FOUNDATION_EXPORT void Open_im_sdkSetConversationRecvMessageOpt(id _Nullable callback, NSString* _Nullable conversationIDList, long opt); +FOUNDATION_EXPORT void Open_im_sdkSetConversationDraft(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, NSString* _Nullable draftText); -FOUNDATION_EXPORT void Open_im_sdkSetFriendInfo(NSString* _Nullable comment, id _Nullable callback); +FOUNDATION_EXPORT void Open_im_sdkSetConversationListener(id _Nullable listener); -FOUNDATION_EXPORT BOOL Open_im_sdkSetFriendListener(id _Nullable listener); +FOUNDATION_EXPORT void Open_im_sdkSetConversationRecvMessageOpt(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList, long opt); -FOUNDATION_EXPORT void Open_im_sdkSetGroupInfo(NSString* _Nullable jsonGroupInfo, id _Nullable callback); +FOUNDATION_EXPORT void Open_im_sdkSetFriendListener(id _Nullable listener); -FOUNDATION_EXPORT void Open_im_sdkSetGroupListener(id _Nullable callback); +FOUNDATION_EXPORT void Open_im_sdkSetFriendRemark(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDRemark); -FOUNDATION_EXPORT void Open_im_sdkSetHearbeatInterval(int32_t interval); +FOUNDATION_EXPORT void Open_im_sdkSetGroupInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable groupInfo); /** - * 1 no print + * ////////////////////////group////////////////////////////////////////// */ -FOUNDATION_EXPORT void Open_im_sdkSetSdkLog(int32_t flag); - -FOUNDATION_EXPORT void Open_im_sdkSetSelfInfo(NSString* _Nullable info, id _Nullable cb); - -FOUNDATION_EXPORT int64_t Open_im_sdkStringToInt64(NSString* _Nullable i); - -FOUNDATION_EXPORT void Open_im_sdkTransferGroupOwner(NSString* _Nullable groupId, NSString* _Nullable userId, id _Nullable callback); - -FOUNDATION_EXPORT void Open_im_sdkTypingStatusUpdate(NSString* _Nullable receiver, NSString* _Nullable msgTip); - -FOUNDATION_EXPORT void Open_im_sdkUnInitSDK(void); - -// skipped function UnixSecondToTime with unsupported parameter or return types - - -// skipped function WarnByKv with unsupported parameter or return types - - -// skipped function Warning with unsupported parameter or return types +FOUNDATION_EXPORT void Open_im_sdkSetGroupListener(id _Nullable callback); +FOUNDATION_EXPORT void Open_im_sdkSetSelfInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userInfo); -@class Open_im_sdkBase; +FOUNDATION_EXPORT void Open_im_sdkSetUserListener(id _Nullable listener); -@class Open_im_sdkIMSDKListener; +FOUNDATION_EXPORT void Open_im_sdkTransferGroupOwner(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable newOwnerUserID); -@class Open_im_sdkOnAdvancedMsgListener; +FOUNDATION_EXPORT void Open_im_sdkTypingStatusUpdate(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable recvID, NSString* _Nullable msgTip); -@class Open_im_sdkOnConversationListener; - -@class Open_im_sdkOnFriendshipListener; - -@class Open_im_sdkOnGroupListener; - -@class Open_im_sdkSendMsgCallBack; - -@interface Open_im_sdkBase : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (void)onError:(long)errCode errMsg:(NSString* _Nullable)errMsg; -- (void)onSuccess:(NSString* _Nullable)data; -@end - -@interface Open_im_sdkIMSDKListener : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (void)onConnectFailed:(long)ErrCode ErrMsg:(NSString* _Nullable)ErrMsg; -- (void)onConnectSuccess; -- (void)onConnecting; -- (void)onKickedOffline; -- (void)onSelfInfoUpdated:(NSString* _Nullable)userInfo; -- (void)onUserTokenExpired; -@end - -@interface Open_im_sdkOnAdvancedMsgListener : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (void)onRecvC2CReadReceipt:(NSString* _Nullable)msgReceiptList; -- (void)onRecvMessageRevoked:(NSString* _Nullable)msgId; -- (void)onRecvNewMessage:(NSString* _Nullable)message; -@end - -@interface Open_im_sdkOnConversationListener : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (void)onConversationChanged:(NSString* _Nullable)conversationList; -- (void)onNewConversation:(NSString* _Nullable)conversationList; -- (void)onSyncServerFailed; -- (void)onSyncServerFinish; -- (void)onSyncServerStart; -- (void)onTotalUnreadMessageCountChanged:(int32_t)totalUnreadCount; -@end - -@interface Open_im_sdkOnFriendshipListener : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (void)onBlackListAdd:(NSString* _Nullable)userInfo; -- (void)onBlackListDeleted:(NSString* _Nullable)userInfo; -- (void)onFriendApplicationListAccept:(NSString* _Nullable)applyUserInfo; -- (void)onFriendApplicationListAdded:(NSString* _Nullable)applyUserInfo; -- (void)onFriendApplicationListDeleted:(NSString* _Nullable)applyUserInfo; -- (void)onFriendApplicationListReject:(NSString* _Nullable)applyUserInfo; -- (void)onFriendInfoChanged:(NSString* _Nullable)friendInfo; -- (void)onFriendListAdded:(NSString* _Nullable)friendInfo; -- (void)onFriendListDeleted:(NSString* _Nullable)friendInfo; -@end - -@interface Open_im_sdkOnGroupListener : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (void)onApplicationProcessed:(NSString* _Nullable)groupId opUser:(NSString* _Nullable)opUser AgreeOrReject:(int32_t)AgreeOrReject opReason:(NSString* _Nullable)opReason; -- (void)onGroupCreated:(NSString* _Nullable)groupId; -- (void)onGroupInfoChanged:(NSString* _Nullable)groupId groupInfo:(NSString* _Nullable)groupInfo; -- (void)onMemberEnter:(NSString* _Nullable)groupId memberList:(NSString* _Nullable)memberList; -- (void)onMemberInvited:(NSString* _Nullable)groupId opUser:(NSString* _Nullable)opUser memberList:(NSString* _Nullable)memberList; -- (void)onMemberKicked:(NSString* _Nullable)groupId opUser:(NSString* _Nullable)opUser memberList:(NSString* _Nullable)memberList; -- (void)onMemberLeave:(NSString* _Nullable)groupId member:(NSString* _Nullable)member; -- (void)onReceiveJoinApplication:(NSString* _Nullable)groupId member:(NSString* _Nullable)member opReason:(NSString* _Nullable)opReason; -@end - -@interface Open_im_sdkSendMsgCallBack : NSObject { -} -@property(strong, readonly) _Nonnull id _ref; - -- (nonnull instancetype)initWithRef:(_Nonnull id)ref; -- (void)onError:(long)errCode errMsg:(NSString* _Nullable)errMsg; -- (void)onProgress:(long)progress; -- (void)onSuccess:(NSString* _Nullable)data; -@end +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkUploadImage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable token, NSString* _Nullable obj); #endif diff --git a/ios/Framework/OpenIMCore.framework/Modules/module.modulemap b/ios/Framework/OpenIMCore.framework/Modules/module.modulemap index af98221..6c7ae76 100644 --- a/ios/Framework/OpenIMCore.framework/Modules/module.modulemap +++ b/ios/Framework/OpenIMCore.framework/Modules/module.modulemap @@ -1,6 +1,7 @@ framework module "OpenIMCore" { header "ref.h" header "Open_im_sdk.objc.h" + header "Open_im_sdk_callback.objc.h" header "Universe.objc.h" header "OpenIMCore.h" diff --git a/ios/Framework/OpenIMCore.framework/OpenIMCore b/ios/Framework/OpenIMCore.framework/OpenIMCore index c003a57..e430959 100644 Binary files a/ios/Framework/OpenIMCore.framework/OpenIMCore and b/ios/Framework/OpenIMCore.framework/OpenIMCore differ diff --git a/ios/Framework/OpenIMCore.xcframework/Info.plist b/ios/Framework/OpenIMCore.xcframework/Info.plist new file mode 100644 index 0000000..35102e0 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/Info.plist @@ -0,0 +1,40 @@ + + + + + AvailableLibraries + + + LibraryIdentifier + ios-arm64 + LibraryPath + OpenIMCore.framework + SupportedArchitectures + + arm64 + + SupportedPlatform + ios + + + LibraryIdentifier + ios-arm64_x86_64-simulator + LibraryPath + OpenIMCore.framework + SupportedArchitectures + + arm64 + x86_64 + + SupportedPlatform + ios + SupportedPlatformVariant + simulator + + + CFBundlePackageType + XFWK + XCFrameworkFormatVersion + 1.0 + + diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Headers/OpenIMCore.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Headers/OpenIMCore.h new file mode 100644 index 0000000..9534b48 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Headers/OpenIMCore.h @@ -0,0 +1,15 @@ + +// Objective-C API for talking to the following Go packages +// +// open_im_sdk/open_im_sdk +// open_im_sdk/open_im_sdk_callback +// +// File is generated by gomobile bind. Do not edit. +#ifndef __OpenIMCore_FRAMEWORK_H__ +#define __OpenIMCore_FRAMEWORK_H__ + +#include "Open_im_sdk.objc.h" +#include "Open_im_sdk_callback.objc.h" +#include "Universe.objc.h" + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Headers/Open_im_sdk.objc.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Headers/Open_im_sdk.objc.h new file mode 100644 index 0000000..7361321 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Headers/Open_im_sdk.objc.h @@ -0,0 +1,206 @@ +// Objective-C API for talking to open_im_sdk/open_im_sdk Go package. +// gobind -lang=objc open_im_sdk/open_im_sdk +// +// File is generated by gobind. Do not edit. + +#ifndef __Open_im_sdk_H__ +#define __Open_im_sdk_H__ + +@import Foundation; +#include "ref.h" +#include "Universe.objc.h" + +#include "Open_im_sdk_callback.objc.h" + +@interface Open_im_sdk : NSObject +// skipped variable UserRouterMap with unsupported type: map[string]*open_im_sdk/internal/login.LoginMgr + +// skipped variable UserSDKRwLock with unsupported type: sync.RWMutex + +@end + +FOUNDATION_EXPORT void Open_im_sdkAcceptFriendApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg); + +FOUNDATION_EXPORT void Open_im_sdkAcceptGroupApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg); + +FOUNDATION_EXPORT void Open_im_sdkAddBlack(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable blackUserID); + +FOUNDATION_EXPORT void Open_im_sdkAddFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDReqMsg); + +FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT BOOL Open_im_sdkCheckToken(NSString* _Nullable userID, NSString* _Nullable token, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID); + +FOUNDATION_EXPORT void Open_im_sdkClearGroupHistoryMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nullable operationID, NSString* _Nullable cardInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable operationID, NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable fileName); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable operationID, NSString* _Nullable fileBaseInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable fileFullPath, NSString* _Nullable fileName); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateForwardMessage(NSString* _Nullable operationID, NSString* _Nullable m); + +FOUNDATION_EXPORT void Open_im_sdkCreateGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupBaseInfo, NSString* _Nullable memberList); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessage(NSString* _Nullable operationID, NSString* _Nullable imagePath); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageByURL(NSString* _Nullable operationID, NSString* _Nullable sourcePicture, NSString* _Nullable bigPicture, NSString* _Nullable snapshotPicture); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable imageFullPath); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateLocationMessage(NSString* _Nullable operationID, NSString* _Nullable description, double longitude, double latitude); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateMergerMessage(NSString* _Nullable operationID, NSString* _Nullable messageList, NSString* _Nullable title, NSString* _Nullable summaryList); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateQuoteMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable message); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessage(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageByURL(NSString* _Nullable operationID, NSString* _Nullable soundBaseInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextAtMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable atUserList); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextMessage(NSString* _Nullable operationID, NSString* _Nullable text); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessage(NSString* _Nullable operationID, NSString* _Nullable videoPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotPath); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageByURL(NSString* _Nullable operationID, NSString* _Nullable videoBaseInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable videoFullPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotFullPath); + +FOUNDATION_EXPORT void Open_im_sdkDeleteConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID); + +FOUNDATION_EXPORT void Open_im_sdkDeleteFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable friendUserID); + +FOUNDATION_EXPORT void Open_im_sdkDeleteMessageFromLocalStorage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message); + +FOUNDATION_EXPORT void Open_im_sdkGetAllConversationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetBlackList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetConversationIDBySessionType(NSString* _Nullable sourceID, long sessionType); + +FOUNDATION_EXPORT void Open_im_sdkGetConversationListSplit(id _Nullable callback, NSString* _Nullable operationID, long offset, long count); + +FOUNDATION_EXPORT void Open_im_sdkGetConversationRecvMessageOpt(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetDesignatedFriendsInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetFriendList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetGroupMemberList(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, int32_t filter, int32_t offset, int32_t count); + +FOUNDATION_EXPORT void Open_im_sdkGetGroupMembersInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetGroupsInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetHistoryMessageList(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable getMessageOptions); + +FOUNDATION_EXPORT void Open_im_sdkGetJoinedGroupList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT int32_t Open_im_sdkGetLoginStatus(void); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetLoginUser(void); + +FOUNDATION_EXPORT void Open_im_sdkGetMultipleConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetOneConversation(id _Nullable callback, NSString* _Nullable operationID, long sessionType, NSString* _Nullable sourceID); + +FOUNDATION_EXPORT void Open_im_sdkGetRecvFriendApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetRecvGroupApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetSelfUserInfo(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetSendFriendApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetSendGroupApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetTotalUnreadMsgCount(id _Nullable callback, NSString* _Nullable operationID); + +// skipped function GetUserWorker with unsupported parameter or return types + + +/** + * /////////////////////user///////////////////// + */ +FOUNDATION_EXPORT void Open_im_sdkGetUsersInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); + +// skipped function InitOnce with unsupported parameter or return types + + +FOUNDATION_EXPORT BOOL Open_im_sdkInitSDK(id _Nullable listener, NSString* _Nullable operationID, NSString* _Nullable config); + +FOUNDATION_EXPORT void Open_im_sdkInsertSingleMessageToLocalStorage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable sendID); + +FOUNDATION_EXPORT void Open_im_sdkInviteUserToGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkJoinGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reqMsg); + +FOUNDATION_EXPORT void Open_im_sdkKickGroupMember(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkLogin(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable token); + +FOUNDATION_EXPORT void Open_im_sdkLogout(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkMarkC2CMessageAsRead(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable msgIDList); + +FOUNDATION_EXPORT void Open_im_sdkMarkGroupMessageHasRead(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); + +FOUNDATION_EXPORT void Open_im_sdkPinConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, BOOL isPinned); + +FOUNDATION_EXPORT void Open_im_sdkQuitGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); + +FOUNDATION_EXPORT void Open_im_sdkRefuseFriendApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg); + +FOUNDATION_EXPORT void Open_im_sdkRefuseGroupApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg); + +FOUNDATION_EXPORT void Open_im_sdkRemoveBlack(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable removeUserID); + +FOUNDATION_EXPORT void Open_im_sdkRevokeMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSdkVersion(void); + +FOUNDATION_EXPORT void Open_im_sdkSendMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo); + +FOUNDATION_EXPORT void Open_im_sdkSendMessageNotOss(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo); + +FOUNDATION_EXPORT void Open_im_sdkSetAdvancedMsgListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkSetConversationDraft(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, NSString* _Nullable draftText); + +FOUNDATION_EXPORT void Open_im_sdkSetConversationListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkSetConversationRecvMessageOpt(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList, long opt); + +FOUNDATION_EXPORT void Open_im_sdkSetFriendListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkSetFriendRemark(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDRemark); + +FOUNDATION_EXPORT void Open_im_sdkSetGroupInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable groupInfo); + +/** + * ////////////////////////group////////////////////////////////////////// + */ +FOUNDATION_EXPORT void Open_im_sdkSetGroupListener(id _Nullable callback); + +FOUNDATION_EXPORT void Open_im_sdkSetSelfInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userInfo); + +FOUNDATION_EXPORT void Open_im_sdkSetUserListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkTransferGroupOwner(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable newOwnerUserID); + +FOUNDATION_EXPORT void Open_im_sdkTypingStatusUpdate(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable recvID, NSString* _Nullable msgTip); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkUploadImage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable token, NSString* _Nullable obj); + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Headers/Universe.objc.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Headers/Universe.objc.h new file mode 100644 index 0000000..019e750 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Headers/Universe.objc.h @@ -0,0 +1,29 @@ +// Objective-C API for talking to Go package. +// gobind -lang=objc +// +// File is generated by gobind. Do not edit. + +#ifndef __Universe_H__ +#define __Universe_H__ + +@import Foundation; +#include "ref.h" + +@protocol Universeerror; +@class Universeerror; + +@protocol Universeerror +- (NSString* _Nonnull)error; +@end + +@class Universeerror; + +@interface Universeerror : NSError { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (NSString* _Nonnull)error; +@end + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Headers/ref.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Headers/ref.h new file mode 100644 index 0000000..b8036a4 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Headers/ref.h @@ -0,0 +1,35 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#ifndef __GO_REF_HDR__ +#define __GO_REF_HDR__ + +#include + +// GoSeqRef is an object tagged with an integer for passing back and +// forth across the language boundary. A GoSeqRef may represent either +// an instance of a Go object, or an Objective-C object passed to Go. +// The explicit allocation of a GoSeqRef is used to pin a Go object +// when it is passed to Objective-C. The Go seq package maintains a +// reference to the Go object in a map keyed by the refnum along with +// a reference count. When the reference count reaches zero, the Go +// seq package will clear the corresponding entry in the map. +@interface GoSeqRef : NSObject { +} +@property(readonly) int32_t refnum; +@property(strong) id obj; // NULL when representing a Go object. + +// new GoSeqRef object to proxy a Go object. The refnum must be +// provided from Go side. +- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj; + +- (int32_t)incNum; + +@end + +@protocol goSeqRefInterface +-(GoSeqRef*) _ref; +@end + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Modules/module.modulemap b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Modules/module.modulemap new file mode 100644 index 0000000..6c7ae76 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Modules/module.modulemap @@ -0,0 +1,9 @@ +framework module "OpenIMCore" { + header "ref.h" + header "Open_im_sdk.objc.h" + header "Open_im_sdk_callback.objc.h" + header "Universe.objc.h" + header "OpenIMCore.h" + + export * +} \ No newline at end of file diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/OpenIMCore b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/OpenIMCore new file mode 100644 index 0000000..e430959 Binary files /dev/null and b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/OpenIMCore differ diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Resources/Info.plist b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Resources/Info.plist new file mode 100644 index 0000000..0d1a4b8 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Resources/Info.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Headers/OpenIMCore.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Headers/OpenIMCore.h new file mode 100644 index 0000000..9534b48 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Headers/OpenIMCore.h @@ -0,0 +1,15 @@ + +// Objective-C API for talking to the following Go packages +// +// open_im_sdk/open_im_sdk +// open_im_sdk/open_im_sdk_callback +// +// File is generated by gomobile bind. Do not edit. +#ifndef __OpenIMCore_FRAMEWORK_H__ +#define __OpenIMCore_FRAMEWORK_H__ + +#include "Open_im_sdk.objc.h" +#include "Open_im_sdk_callback.objc.h" +#include "Universe.objc.h" + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Headers/Open_im_sdk.objc.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Headers/Open_im_sdk.objc.h new file mode 100644 index 0000000..7361321 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Headers/Open_im_sdk.objc.h @@ -0,0 +1,206 @@ +// Objective-C API for talking to open_im_sdk/open_im_sdk Go package. +// gobind -lang=objc open_im_sdk/open_im_sdk +// +// File is generated by gobind. Do not edit. + +#ifndef __Open_im_sdk_H__ +#define __Open_im_sdk_H__ + +@import Foundation; +#include "ref.h" +#include "Universe.objc.h" + +#include "Open_im_sdk_callback.objc.h" + +@interface Open_im_sdk : NSObject +// skipped variable UserRouterMap with unsupported type: map[string]*open_im_sdk/internal/login.LoginMgr + +// skipped variable UserSDKRwLock with unsupported type: sync.RWMutex + +@end + +FOUNDATION_EXPORT void Open_im_sdkAcceptFriendApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg); + +FOUNDATION_EXPORT void Open_im_sdkAcceptGroupApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg); + +FOUNDATION_EXPORT void Open_im_sdkAddBlack(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable blackUserID); + +FOUNDATION_EXPORT void Open_im_sdkAddFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDReqMsg); + +FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT BOOL Open_im_sdkCheckToken(NSString* _Nullable userID, NSString* _Nullable token, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID); + +FOUNDATION_EXPORT void Open_im_sdkClearGroupHistoryMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nullable operationID, NSString* _Nullable cardInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable operationID, NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable fileName); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable operationID, NSString* _Nullable fileBaseInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable fileFullPath, NSString* _Nullable fileName); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateForwardMessage(NSString* _Nullable operationID, NSString* _Nullable m); + +FOUNDATION_EXPORT void Open_im_sdkCreateGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupBaseInfo, NSString* _Nullable memberList); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessage(NSString* _Nullable operationID, NSString* _Nullable imagePath); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageByURL(NSString* _Nullable operationID, NSString* _Nullable sourcePicture, NSString* _Nullable bigPicture, NSString* _Nullable snapshotPicture); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable imageFullPath); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateLocationMessage(NSString* _Nullable operationID, NSString* _Nullable description, double longitude, double latitude); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateMergerMessage(NSString* _Nullable operationID, NSString* _Nullable messageList, NSString* _Nullable title, NSString* _Nullable summaryList); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateQuoteMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable message); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessage(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageByURL(NSString* _Nullable operationID, NSString* _Nullable soundBaseInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextAtMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable atUserList); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextMessage(NSString* _Nullable operationID, NSString* _Nullable text); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessage(NSString* _Nullable operationID, NSString* _Nullable videoPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotPath); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageByURL(NSString* _Nullable operationID, NSString* _Nullable videoBaseInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable videoFullPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotFullPath); + +FOUNDATION_EXPORT void Open_im_sdkDeleteConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID); + +FOUNDATION_EXPORT void Open_im_sdkDeleteFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable friendUserID); + +FOUNDATION_EXPORT void Open_im_sdkDeleteMessageFromLocalStorage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message); + +FOUNDATION_EXPORT void Open_im_sdkGetAllConversationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetBlackList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetConversationIDBySessionType(NSString* _Nullable sourceID, long sessionType); + +FOUNDATION_EXPORT void Open_im_sdkGetConversationListSplit(id _Nullable callback, NSString* _Nullable operationID, long offset, long count); + +FOUNDATION_EXPORT void Open_im_sdkGetConversationRecvMessageOpt(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetDesignatedFriendsInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetFriendList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetGroupMemberList(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, int32_t filter, int32_t offset, int32_t count); + +FOUNDATION_EXPORT void Open_im_sdkGetGroupMembersInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetGroupsInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetHistoryMessageList(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable getMessageOptions); + +FOUNDATION_EXPORT void Open_im_sdkGetJoinedGroupList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT int32_t Open_im_sdkGetLoginStatus(void); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetLoginUser(void); + +FOUNDATION_EXPORT void Open_im_sdkGetMultipleConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetOneConversation(id _Nullable callback, NSString* _Nullable operationID, long sessionType, NSString* _Nullable sourceID); + +FOUNDATION_EXPORT void Open_im_sdkGetRecvFriendApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetRecvGroupApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetSelfUserInfo(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetSendFriendApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetSendGroupApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetTotalUnreadMsgCount(id _Nullable callback, NSString* _Nullable operationID); + +// skipped function GetUserWorker with unsupported parameter or return types + + +/** + * /////////////////////user///////////////////// + */ +FOUNDATION_EXPORT void Open_im_sdkGetUsersInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); + +// skipped function InitOnce with unsupported parameter or return types + + +FOUNDATION_EXPORT BOOL Open_im_sdkInitSDK(id _Nullable listener, NSString* _Nullable operationID, NSString* _Nullable config); + +FOUNDATION_EXPORT void Open_im_sdkInsertSingleMessageToLocalStorage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable sendID); + +FOUNDATION_EXPORT void Open_im_sdkInviteUserToGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkJoinGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reqMsg); + +FOUNDATION_EXPORT void Open_im_sdkKickGroupMember(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkLogin(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable token); + +FOUNDATION_EXPORT void Open_im_sdkLogout(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkMarkC2CMessageAsRead(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable msgIDList); + +FOUNDATION_EXPORT void Open_im_sdkMarkGroupMessageHasRead(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); + +FOUNDATION_EXPORT void Open_im_sdkPinConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, BOOL isPinned); + +FOUNDATION_EXPORT void Open_im_sdkQuitGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); + +FOUNDATION_EXPORT void Open_im_sdkRefuseFriendApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg); + +FOUNDATION_EXPORT void Open_im_sdkRefuseGroupApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg); + +FOUNDATION_EXPORT void Open_im_sdkRemoveBlack(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable removeUserID); + +FOUNDATION_EXPORT void Open_im_sdkRevokeMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSdkVersion(void); + +FOUNDATION_EXPORT void Open_im_sdkSendMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo); + +FOUNDATION_EXPORT void Open_im_sdkSendMessageNotOss(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo); + +FOUNDATION_EXPORT void Open_im_sdkSetAdvancedMsgListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkSetConversationDraft(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, NSString* _Nullable draftText); + +FOUNDATION_EXPORT void Open_im_sdkSetConversationListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkSetConversationRecvMessageOpt(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList, long opt); + +FOUNDATION_EXPORT void Open_im_sdkSetFriendListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkSetFriendRemark(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDRemark); + +FOUNDATION_EXPORT void Open_im_sdkSetGroupInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable groupInfo); + +/** + * ////////////////////////group////////////////////////////////////////// + */ +FOUNDATION_EXPORT void Open_im_sdkSetGroupListener(id _Nullable callback); + +FOUNDATION_EXPORT void Open_im_sdkSetSelfInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userInfo); + +FOUNDATION_EXPORT void Open_im_sdkSetUserListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkTransferGroupOwner(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable newOwnerUserID); + +FOUNDATION_EXPORT void Open_im_sdkTypingStatusUpdate(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable recvID, NSString* _Nullable msgTip); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkUploadImage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable token, NSString* _Nullable obj); + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Headers/Universe.objc.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Headers/Universe.objc.h new file mode 100644 index 0000000..019e750 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Headers/Universe.objc.h @@ -0,0 +1,29 @@ +// Objective-C API for talking to Go package. +// gobind -lang=objc +// +// File is generated by gobind. Do not edit. + +#ifndef __Universe_H__ +#define __Universe_H__ + +@import Foundation; +#include "ref.h" + +@protocol Universeerror; +@class Universeerror; + +@protocol Universeerror +- (NSString* _Nonnull)error; +@end + +@class Universeerror; + +@interface Universeerror : NSError { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (NSString* _Nonnull)error; +@end + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Headers/ref.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Headers/ref.h new file mode 100644 index 0000000..b8036a4 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Headers/ref.h @@ -0,0 +1,35 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#ifndef __GO_REF_HDR__ +#define __GO_REF_HDR__ + +#include + +// GoSeqRef is an object tagged with an integer for passing back and +// forth across the language boundary. A GoSeqRef may represent either +// an instance of a Go object, or an Objective-C object passed to Go. +// The explicit allocation of a GoSeqRef is used to pin a Go object +// when it is passed to Objective-C. The Go seq package maintains a +// reference to the Go object in a map keyed by the refnum along with +// a reference count. When the reference count reaches zero, the Go +// seq package will clear the corresponding entry in the map. +@interface GoSeqRef : NSObject { +} +@property(readonly) int32_t refnum; +@property(strong) id obj; // NULL when representing a Go object. + +// new GoSeqRef object to proxy a Go object. The refnum must be +// provided from Go side. +- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj; + +- (int32_t)incNum; + +@end + +@protocol goSeqRefInterface +-(GoSeqRef*) _ref; +@end + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Modules/module.modulemap b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..6c7ae76 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,9 @@ +framework module "OpenIMCore" { + header "ref.h" + header "Open_im_sdk.objc.h" + header "Open_im_sdk_callback.objc.h" + header "Universe.objc.h" + header "OpenIMCore.h" + + export * +} \ No newline at end of file diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/OpenIMCore b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/OpenIMCore new file mode 100644 index 0000000..e430959 Binary files /dev/null and b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/OpenIMCore differ diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Resources/Info.plist b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..0d1a4b8 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Headers/OpenIMCore.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Headers/OpenIMCore.h new file mode 100644 index 0000000..9534b48 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Headers/OpenIMCore.h @@ -0,0 +1,15 @@ + +// Objective-C API for talking to the following Go packages +// +// open_im_sdk/open_im_sdk +// open_im_sdk/open_im_sdk_callback +// +// File is generated by gomobile bind. Do not edit. +#ifndef __OpenIMCore_FRAMEWORK_H__ +#define __OpenIMCore_FRAMEWORK_H__ + +#include "Open_im_sdk.objc.h" +#include "Open_im_sdk_callback.objc.h" +#include "Universe.objc.h" + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Headers/Open_im_sdk.objc.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Headers/Open_im_sdk.objc.h new file mode 100644 index 0000000..7361321 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Headers/Open_im_sdk.objc.h @@ -0,0 +1,206 @@ +// Objective-C API for talking to open_im_sdk/open_im_sdk Go package. +// gobind -lang=objc open_im_sdk/open_im_sdk +// +// File is generated by gobind. Do not edit. + +#ifndef __Open_im_sdk_H__ +#define __Open_im_sdk_H__ + +@import Foundation; +#include "ref.h" +#include "Universe.objc.h" + +#include "Open_im_sdk_callback.objc.h" + +@interface Open_im_sdk : NSObject +// skipped variable UserRouterMap with unsupported type: map[string]*open_im_sdk/internal/login.LoginMgr + +// skipped variable UserSDKRwLock with unsupported type: sync.RWMutex + +@end + +FOUNDATION_EXPORT void Open_im_sdkAcceptFriendApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg); + +FOUNDATION_EXPORT void Open_im_sdkAcceptGroupApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg); + +FOUNDATION_EXPORT void Open_im_sdkAddBlack(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable blackUserID); + +FOUNDATION_EXPORT void Open_im_sdkAddFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDReqMsg); + +FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT BOOL Open_im_sdkCheckToken(NSString* _Nullable userID, NSString* _Nullable token, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID); + +FOUNDATION_EXPORT void Open_im_sdkClearGroupHistoryMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nullable operationID, NSString* _Nullable cardInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable operationID, NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable fileName); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable operationID, NSString* _Nullable fileBaseInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable fileFullPath, NSString* _Nullable fileName); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateForwardMessage(NSString* _Nullable operationID, NSString* _Nullable m); + +FOUNDATION_EXPORT void Open_im_sdkCreateGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupBaseInfo, NSString* _Nullable memberList); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessage(NSString* _Nullable operationID, NSString* _Nullable imagePath); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageByURL(NSString* _Nullable operationID, NSString* _Nullable sourcePicture, NSString* _Nullable bigPicture, NSString* _Nullable snapshotPicture); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable imageFullPath); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateLocationMessage(NSString* _Nullable operationID, NSString* _Nullable description, double longitude, double latitude); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateMergerMessage(NSString* _Nullable operationID, NSString* _Nullable messageList, NSString* _Nullable title, NSString* _Nullable summaryList); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateQuoteMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable message); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessage(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageByURL(NSString* _Nullable operationID, NSString* _Nullable soundBaseInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextAtMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable atUserList); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextMessage(NSString* _Nullable operationID, NSString* _Nullable text); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessage(NSString* _Nullable operationID, NSString* _Nullable videoPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotPath); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageByURL(NSString* _Nullable operationID, NSString* _Nullable videoBaseInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable videoFullPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotFullPath); + +FOUNDATION_EXPORT void Open_im_sdkDeleteConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID); + +FOUNDATION_EXPORT void Open_im_sdkDeleteFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable friendUserID); + +FOUNDATION_EXPORT void Open_im_sdkDeleteMessageFromLocalStorage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message); + +FOUNDATION_EXPORT void Open_im_sdkGetAllConversationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetBlackList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetConversationIDBySessionType(NSString* _Nullable sourceID, long sessionType); + +FOUNDATION_EXPORT void Open_im_sdkGetConversationListSplit(id _Nullable callback, NSString* _Nullable operationID, long offset, long count); + +FOUNDATION_EXPORT void Open_im_sdkGetConversationRecvMessageOpt(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetDesignatedFriendsInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetFriendList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetGroupMemberList(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, int32_t filter, int32_t offset, int32_t count); + +FOUNDATION_EXPORT void Open_im_sdkGetGroupMembersInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetGroupsInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetHistoryMessageList(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable getMessageOptions); + +FOUNDATION_EXPORT void Open_im_sdkGetJoinedGroupList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT int32_t Open_im_sdkGetLoginStatus(void); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetLoginUser(void); + +FOUNDATION_EXPORT void Open_im_sdkGetMultipleConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetOneConversation(id _Nullable callback, NSString* _Nullable operationID, long sessionType, NSString* _Nullable sourceID); + +FOUNDATION_EXPORT void Open_im_sdkGetRecvFriendApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetRecvGroupApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetSelfUserInfo(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetSendFriendApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetSendGroupApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetTotalUnreadMsgCount(id _Nullable callback, NSString* _Nullable operationID); + +// skipped function GetUserWorker with unsupported parameter or return types + + +/** + * /////////////////////user///////////////////// + */ +FOUNDATION_EXPORT void Open_im_sdkGetUsersInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); + +// skipped function InitOnce with unsupported parameter or return types + + +FOUNDATION_EXPORT BOOL Open_im_sdkInitSDK(id _Nullable listener, NSString* _Nullable operationID, NSString* _Nullable config); + +FOUNDATION_EXPORT void Open_im_sdkInsertSingleMessageToLocalStorage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable sendID); + +FOUNDATION_EXPORT void Open_im_sdkInviteUserToGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkJoinGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reqMsg); + +FOUNDATION_EXPORT void Open_im_sdkKickGroupMember(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkLogin(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable token); + +FOUNDATION_EXPORT void Open_im_sdkLogout(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkMarkC2CMessageAsRead(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable msgIDList); + +FOUNDATION_EXPORT void Open_im_sdkMarkGroupMessageHasRead(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); + +FOUNDATION_EXPORT void Open_im_sdkPinConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, BOOL isPinned); + +FOUNDATION_EXPORT void Open_im_sdkQuitGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); + +FOUNDATION_EXPORT void Open_im_sdkRefuseFriendApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg); + +FOUNDATION_EXPORT void Open_im_sdkRefuseGroupApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg); + +FOUNDATION_EXPORT void Open_im_sdkRemoveBlack(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable removeUserID); + +FOUNDATION_EXPORT void Open_im_sdkRevokeMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSdkVersion(void); + +FOUNDATION_EXPORT void Open_im_sdkSendMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo); + +FOUNDATION_EXPORT void Open_im_sdkSendMessageNotOss(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo); + +FOUNDATION_EXPORT void Open_im_sdkSetAdvancedMsgListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkSetConversationDraft(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, NSString* _Nullable draftText); + +FOUNDATION_EXPORT void Open_im_sdkSetConversationListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkSetConversationRecvMessageOpt(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList, long opt); + +FOUNDATION_EXPORT void Open_im_sdkSetFriendListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkSetFriendRemark(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDRemark); + +FOUNDATION_EXPORT void Open_im_sdkSetGroupInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable groupInfo); + +/** + * ////////////////////////group////////////////////////////////////////// + */ +FOUNDATION_EXPORT void Open_im_sdkSetGroupListener(id _Nullable callback); + +FOUNDATION_EXPORT void Open_im_sdkSetSelfInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userInfo); + +FOUNDATION_EXPORT void Open_im_sdkSetUserListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkTransferGroupOwner(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable newOwnerUserID); + +FOUNDATION_EXPORT void Open_im_sdkTypingStatusUpdate(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable recvID, NSString* _Nullable msgTip); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkUploadImage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable token, NSString* _Nullable obj); + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Headers/Universe.objc.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Headers/Universe.objc.h new file mode 100644 index 0000000..019e750 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Headers/Universe.objc.h @@ -0,0 +1,29 @@ +// Objective-C API for talking to Go package. +// gobind -lang=objc +// +// File is generated by gobind. Do not edit. + +#ifndef __Universe_H__ +#define __Universe_H__ + +@import Foundation; +#include "ref.h" + +@protocol Universeerror; +@class Universeerror; + +@protocol Universeerror +- (NSString* _Nonnull)error; +@end + +@class Universeerror; + +@interface Universeerror : NSError { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (NSString* _Nonnull)error; +@end + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Headers/ref.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Headers/ref.h new file mode 100644 index 0000000..b8036a4 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Headers/ref.h @@ -0,0 +1,35 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#ifndef __GO_REF_HDR__ +#define __GO_REF_HDR__ + +#include + +// GoSeqRef is an object tagged with an integer for passing back and +// forth across the language boundary. A GoSeqRef may represent either +// an instance of a Go object, or an Objective-C object passed to Go. +// The explicit allocation of a GoSeqRef is used to pin a Go object +// when it is passed to Objective-C. The Go seq package maintains a +// reference to the Go object in a map keyed by the refnum along with +// a reference count. When the reference count reaches zero, the Go +// seq package will clear the corresponding entry in the map. +@interface GoSeqRef : NSObject { +} +@property(readonly) int32_t refnum; +@property(strong) id obj; // NULL when representing a Go object. + +// new GoSeqRef object to proxy a Go object. The refnum must be +// provided from Go side. +- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj; + +- (int32_t)incNum; + +@end + +@protocol goSeqRefInterface +-(GoSeqRef*) _ref; +@end + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Modules/module.modulemap b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Modules/module.modulemap new file mode 100644 index 0000000..6c7ae76 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Modules/module.modulemap @@ -0,0 +1,9 @@ +framework module "OpenIMCore" { + header "ref.h" + header "Open_im_sdk.objc.h" + header "Open_im_sdk_callback.objc.h" + header "Universe.objc.h" + header "OpenIMCore.h" + + export * +} \ No newline at end of file diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/OpenIMCore b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/OpenIMCore new file mode 100644 index 0000000..e430959 Binary files /dev/null and b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/OpenIMCore differ diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Resources/Info.plist b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Resources/Info.plist new file mode 100644 index 0000000..0d1a4b8 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64/OpenIMCore.framework/Versions/Current/Resources/Info.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Headers/OpenIMCore.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Headers/OpenIMCore.h new file mode 100644 index 0000000..9534b48 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Headers/OpenIMCore.h @@ -0,0 +1,15 @@ + +// Objective-C API for talking to the following Go packages +// +// open_im_sdk/open_im_sdk +// open_im_sdk/open_im_sdk_callback +// +// File is generated by gomobile bind. Do not edit. +#ifndef __OpenIMCore_FRAMEWORK_H__ +#define __OpenIMCore_FRAMEWORK_H__ + +#include "Open_im_sdk.objc.h" +#include "Open_im_sdk_callback.objc.h" +#include "Universe.objc.h" + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Headers/Open_im_sdk.objc.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Headers/Open_im_sdk.objc.h new file mode 100644 index 0000000..7361321 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Headers/Open_im_sdk.objc.h @@ -0,0 +1,206 @@ +// Objective-C API for talking to open_im_sdk/open_im_sdk Go package. +// gobind -lang=objc open_im_sdk/open_im_sdk +// +// File is generated by gobind. Do not edit. + +#ifndef __Open_im_sdk_H__ +#define __Open_im_sdk_H__ + +@import Foundation; +#include "ref.h" +#include "Universe.objc.h" + +#include "Open_im_sdk_callback.objc.h" + +@interface Open_im_sdk : NSObject +// skipped variable UserRouterMap with unsupported type: map[string]*open_im_sdk/internal/login.LoginMgr + +// skipped variable UserSDKRwLock with unsupported type: sync.RWMutex + +@end + +FOUNDATION_EXPORT void Open_im_sdkAcceptFriendApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg); + +FOUNDATION_EXPORT void Open_im_sdkAcceptGroupApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg); + +FOUNDATION_EXPORT void Open_im_sdkAddBlack(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable blackUserID); + +FOUNDATION_EXPORT void Open_im_sdkAddFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDReqMsg); + +FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT BOOL Open_im_sdkCheckToken(NSString* _Nullable userID, NSString* _Nullable token, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID); + +FOUNDATION_EXPORT void Open_im_sdkClearGroupHistoryMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nullable operationID, NSString* _Nullable cardInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable operationID, NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable fileName); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable operationID, NSString* _Nullable fileBaseInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable fileFullPath, NSString* _Nullable fileName); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateForwardMessage(NSString* _Nullable operationID, NSString* _Nullable m); + +FOUNDATION_EXPORT void Open_im_sdkCreateGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupBaseInfo, NSString* _Nullable memberList); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessage(NSString* _Nullable operationID, NSString* _Nullable imagePath); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageByURL(NSString* _Nullable operationID, NSString* _Nullable sourcePicture, NSString* _Nullable bigPicture, NSString* _Nullable snapshotPicture); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable imageFullPath); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateLocationMessage(NSString* _Nullable operationID, NSString* _Nullable description, double longitude, double latitude); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateMergerMessage(NSString* _Nullable operationID, NSString* _Nullable messageList, NSString* _Nullable title, NSString* _Nullable summaryList); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateQuoteMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable message); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessage(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageByURL(NSString* _Nullable operationID, NSString* _Nullable soundBaseInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextAtMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable atUserList); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextMessage(NSString* _Nullable operationID, NSString* _Nullable text); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessage(NSString* _Nullable operationID, NSString* _Nullable videoPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotPath); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageByURL(NSString* _Nullable operationID, NSString* _Nullable videoBaseInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable videoFullPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotFullPath); + +FOUNDATION_EXPORT void Open_im_sdkDeleteConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID); + +FOUNDATION_EXPORT void Open_im_sdkDeleteFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable friendUserID); + +FOUNDATION_EXPORT void Open_im_sdkDeleteMessageFromLocalStorage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message); + +FOUNDATION_EXPORT void Open_im_sdkGetAllConversationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetBlackList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetConversationIDBySessionType(NSString* _Nullable sourceID, long sessionType); + +FOUNDATION_EXPORT void Open_im_sdkGetConversationListSplit(id _Nullable callback, NSString* _Nullable operationID, long offset, long count); + +FOUNDATION_EXPORT void Open_im_sdkGetConversationRecvMessageOpt(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetDesignatedFriendsInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetFriendList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetGroupMemberList(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, int32_t filter, int32_t offset, int32_t count); + +FOUNDATION_EXPORT void Open_im_sdkGetGroupMembersInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetGroupsInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetHistoryMessageList(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable getMessageOptions); + +FOUNDATION_EXPORT void Open_im_sdkGetJoinedGroupList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT int32_t Open_im_sdkGetLoginStatus(void); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetLoginUser(void); + +FOUNDATION_EXPORT void Open_im_sdkGetMultipleConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetOneConversation(id _Nullable callback, NSString* _Nullable operationID, long sessionType, NSString* _Nullable sourceID); + +FOUNDATION_EXPORT void Open_im_sdkGetRecvFriendApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetRecvGroupApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetSelfUserInfo(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetSendFriendApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetSendGroupApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetTotalUnreadMsgCount(id _Nullable callback, NSString* _Nullable operationID); + +// skipped function GetUserWorker with unsupported parameter or return types + + +/** + * /////////////////////user///////////////////// + */ +FOUNDATION_EXPORT void Open_im_sdkGetUsersInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); + +// skipped function InitOnce with unsupported parameter or return types + + +FOUNDATION_EXPORT BOOL Open_im_sdkInitSDK(id _Nullable listener, NSString* _Nullable operationID, NSString* _Nullable config); + +FOUNDATION_EXPORT void Open_im_sdkInsertSingleMessageToLocalStorage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable sendID); + +FOUNDATION_EXPORT void Open_im_sdkInviteUserToGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkJoinGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reqMsg); + +FOUNDATION_EXPORT void Open_im_sdkKickGroupMember(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkLogin(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable token); + +FOUNDATION_EXPORT void Open_im_sdkLogout(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkMarkC2CMessageAsRead(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable msgIDList); + +FOUNDATION_EXPORT void Open_im_sdkMarkGroupMessageHasRead(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); + +FOUNDATION_EXPORT void Open_im_sdkPinConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, BOOL isPinned); + +FOUNDATION_EXPORT void Open_im_sdkQuitGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); + +FOUNDATION_EXPORT void Open_im_sdkRefuseFriendApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg); + +FOUNDATION_EXPORT void Open_im_sdkRefuseGroupApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg); + +FOUNDATION_EXPORT void Open_im_sdkRemoveBlack(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable removeUserID); + +FOUNDATION_EXPORT void Open_im_sdkRevokeMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSdkVersion(void); + +FOUNDATION_EXPORT void Open_im_sdkSendMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo); + +FOUNDATION_EXPORT void Open_im_sdkSendMessageNotOss(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo); + +FOUNDATION_EXPORT void Open_im_sdkSetAdvancedMsgListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkSetConversationDraft(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, NSString* _Nullable draftText); + +FOUNDATION_EXPORT void Open_im_sdkSetConversationListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkSetConversationRecvMessageOpt(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList, long opt); + +FOUNDATION_EXPORT void Open_im_sdkSetFriendListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkSetFriendRemark(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDRemark); + +FOUNDATION_EXPORT void Open_im_sdkSetGroupInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable groupInfo); + +/** + * ////////////////////////group////////////////////////////////////////// + */ +FOUNDATION_EXPORT void Open_im_sdkSetGroupListener(id _Nullable callback); + +FOUNDATION_EXPORT void Open_im_sdkSetSelfInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userInfo); + +FOUNDATION_EXPORT void Open_im_sdkSetUserListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkTransferGroupOwner(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable newOwnerUserID); + +FOUNDATION_EXPORT void Open_im_sdkTypingStatusUpdate(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable recvID, NSString* _Nullable msgTip); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkUploadImage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable token, NSString* _Nullable obj); + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Headers/Universe.objc.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Headers/Universe.objc.h new file mode 100644 index 0000000..019e750 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Headers/Universe.objc.h @@ -0,0 +1,29 @@ +// Objective-C API for talking to Go package. +// gobind -lang=objc +// +// File is generated by gobind. Do not edit. + +#ifndef __Universe_H__ +#define __Universe_H__ + +@import Foundation; +#include "ref.h" + +@protocol Universeerror; +@class Universeerror; + +@protocol Universeerror +- (NSString* _Nonnull)error; +@end + +@class Universeerror; + +@interface Universeerror : NSError { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (NSString* _Nonnull)error; +@end + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Headers/ref.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Headers/ref.h new file mode 100644 index 0000000..b8036a4 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Headers/ref.h @@ -0,0 +1,35 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#ifndef __GO_REF_HDR__ +#define __GO_REF_HDR__ + +#include + +// GoSeqRef is an object tagged with an integer for passing back and +// forth across the language boundary. A GoSeqRef may represent either +// an instance of a Go object, or an Objective-C object passed to Go. +// The explicit allocation of a GoSeqRef is used to pin a Go object +// when it is passed to Objective-C. The Go seq package maintains a +// reference to the Go object in a map keyed by the refnum along with +// a reference count. When the reference count reaches zero, the Go +// seq package will clear the corresponding entry in the map. +@interface GoSeqRef : NSObject { +} +@property(readonly) int32_t refnum; +@property(strong) id obj; // NULL when representing a Go object. + +// new GoSeqRef object to proxy a Go object. The refnum must be +// provided from Go side. +- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj; + +- (int32_t)incNum; + +@end + +@protocol goSeqRefInterface +-(GoSeqRef*) _ref; +@end + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Modules/module.modulemap b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Modules/module.modulemap new file mode 100644 index 0000000..6c7ae76 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Modules/module.modulemap @@ -0,0 +1,9 @@ +framework module "OpenIMCore" { + header "ref.h" + header "Open_im_sdk.objc.h" + header "Open_im_sdk_callback.objc.h" + header "Universe.objc.h" + header "OpenIMCore.h" + + export * +} \ No newline at end of file diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/OpenIMCore b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/OpenIMCore new file mode 100644 index 0000000..feca0c6 Binary files /dev/null and b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/OpenIMCore differ diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Resources/Info.plist b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Resources/Info.plist new file mode 100644 index 0000000..0d1a4b8 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Resources/Info.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Headers/OpenIMCore.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Headers/OpenIMCore.h new file mode 100644 index 0000000..9534b48 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Headers/OpenIMCore.h @@ -0,0 +1,15 @@ + +// Objective-C API for talking to the following Go packages +// +// open_im_sdk/open_im_sdk +// open_im_sdk/open_im_sdk_callback +// +// File is generated by gomobile bind. Do not edit. +#ifndef __OpenIMCore_FRAMEWORK_H__ +#define __OpenIMCore_FRAMEWORK_H__ + +#include "Open_im_sdk.objc.h" +#include "Open_im_sdk_callback.objc.h" +#include "Universe.objc.h" + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Headers/Open_im_sdk.objc.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Headers/Open_im_sdk.objc.h new file mode 100644 index 0000000..7361321 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Headers/Open_im_sdk.objc.h @@ -0,0 +1,206 @@ +// Objective-C API for talking to open_im_sdk/open_im_sdk Go package. +// gobind -lang=objc open_im_sdk/open_im_sdk +// +// File is generated by gobind. Do not edit. + +#ifndef __Open_im_sdk_H__ +#define __Open_im_sdk_H__ + +@import Foundation; +#include "ref.h" +#include "Universe.objc.h" + +#include "Open_im_sdk_callback.objc.h" + +@interface Open_im_sdk : NSObject +// skipped variable UserRouterMap with unsupported type: map[string]*open_im_sdk/internal/login.LoginMgr + +// skipped variable UserSDKRwLock with unsupported type: sync.RWMutex + +@end + +FOUNDATION_EXPORT void Open_im_sdkAcceptFriendApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg); + +FOUNDATION_EXPORT void Open_im_sdkAcceptGroupApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg); + +FOUNDATION_EXPORT void Open_im_sdkAddBlack(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable blackUserID); + +FOUNDATION_EXPORT void Open_im_sdkAddFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDReqMsg); + +FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT BOOL Open_im_sdkCheckToken(NSString* _Nullable userID, NSString* _Nullable token, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID); + +FOUNDATION_EXPORT void Open_im_sdkClearGroupHistoryMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nullable operationID, NSString* _Nullable cardInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable operationID, NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable fileName); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable operationID, NSString* _Nullable fileBaseInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable fileFullPath, NSString* _Nullable fileName); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateForwardMessage(NSString* _Nullable operationID, NSString* _Nullable m); + +FOUNDATION_EXPORT void Open_im_sdkCreateGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupBaseInfo, NSString* _Nullable memberList); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessage(NSString* _Nullable operationID, NSString* _Nullable imagePath); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageByURL(NSString* _Nullable operationID, NSString* _Nullable sourcePicture, NSString* _Nullable bigPicture, NSString* _Nullable snapshotPicture); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable imageFullPath); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateLocationMessage(NSString* _Nullable operationID, NSString* _Nullable description, double longitude, double latitude); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateMergerMessage(NSString* _Nullable operationID, NSString* _Nullable messageList, NSString* _Nullable title, NSString* _Nullable summaryList); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateQuoteMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable message); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessage(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageByURL(NSString* _Nullable operationID, NSString* _Nullable soundBaseInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextAtMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable atUserList); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextMessage(NSString* _Nullable operationID, NSString* _Nullable text); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessage(NSString* _Nullable operationID, NSString* _Nullable videoPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotPath); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageByURL(NSString* _Nullable operationID, NSString* _Nullable videoBaseInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable videoFullPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotFullPath); + +FOUNDATION_EXPORT void Open_im_sdkDeleteConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID); + +FOUNDATION_EXPORT void Open_im_sdkDeleteFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable friendUserID); + +FOUNDATION_EXPORT void Open_im_sdkDeleteMessageFromLocalStorage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message); + +FOUNDATION_EXPORT void Open_im_sdkGetAllConversationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetBlackList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetConversationIDBySessionType(NSString* _Nullable sourceID, long sessionType); + +FOUNDATION_EXPORT void Open_im_sdkGetConversationListSplit(id _Nullable callback, NSString* _Nullable operationID, long offset, long count); + +FOUNDATION_EXPORT void Open_im_sdkGetConversationRecvMessageOpt(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetDesignatedFriendsInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetFriendList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetGroupMemberList(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, int32_t filter, int32_t offset, int32_t count); + +FOUNDATION_EXPORT void Open_im_sdkGetGroupMembersInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetGroupsInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetHistoryMessageList(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable getMessageOptions); + +FOUNDATION_EXPORT void Open_im_sdkGetJoinedGroupList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT int32_t Open_im_sdkGetLoginStatus(void); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetLoginUser(void); + +FOUNDATION_EXPORT void Open_im_sdkGetMultipleConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetOneConversation(id _Nullable callback, NSString* _Nullable operationID, long sessionType, NSString* _Nullable sourceID); + +FOUNDATION_EXPORT void Open_im_sdkGetRecvFriendApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetRecvGroupApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetSelfUserInfo(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetSendFriendApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetSendGroupApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetTotalUnreadMsgCount(id _Nullable callback, NSString* _Nullable operationID); + +// skipped function GetUserWorker with unsupported parameter or return types + + +/** + * /////////////////////user///////////////////// + */ +FOUNDATION_EXPORT void Open_im_sdkGetUsersInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); + +// skipped function InitOnce with unsupported parameter or return types + + +FOUNDATION_EXPORT BOOL Open_im_sdkInitSDK(id _Nullable listener, NSString* _Nullable operationID, NSString* _Nullable config); + +FOUNDATION_EXPORT void Open_im_sdkInsertSingleMessageToLocalStorage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable sendID); + +FOUNDATION_EXPORT void Open_im_sdkInviteUserToGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkJoinGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reqMsg); + +FOUNDATION_EXPORT void Open_im_sdkKickGroupMember(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkLogin(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable token); + +FOUNDATION_EXPORT void Open_im_sdkLogout(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkMarkC2CMessageAsRead(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable msgIDList); + +FOUNDATION_EXPORT void Open_im_sdkMarkGroupMessageHasRead(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); + +FOUNDATION_EXPORT void Open_im_sdkPinConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, BOOL isPinned); + +FOUNDATION_EXPORT void Open_im_sdkQuitGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); + +FOUNDATION_EXPORT void Open_im_sdkRefuseFriendApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg); + +FOUNDATION_EXPORT void Open_im_sdkRefuseGroupApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg); + +FOUNDATION_EXPORT void Open_im_sdkRemoveBlack(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable removeUserID); + +FOUNDATION_EXPORT void Open_im_sdkRevokeMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSdkVersion(void); + +FOUNDATION_EXPORT void Open_im_sdkSendMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo); + +FOUNDATION_EXPORT void Open_im_sdkSendMessageNotOss(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo); + +FOUNDATION_EXPORT void Open_im_sdkSetAdvancedMsgListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkSetConversationDraft(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, NSString* _Nullable draftText); + +FOUNDATION_EXPORT void Open_im_sdkSetConversationListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkSetConversationRecvMessageOpt(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList, long opt); + +FOUNDATION_EXPORT void Open_im_sdkSetFriendListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkSetFriendRemark(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDRemark); + +FOUNDATION_EXPORT void Open_im_sdkSetGroupInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable groupInfo); + +/** + * ////////////////////////group////////////////////////////////////////// + */ +FOUNDATION_EXPORT void Open_im_sdkSetGroupListener(id _Nullable callback); + +FOUNDATION_EXPORT void Open_im_sdkSetSelfInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userInfo); + +FOUNDATION_EXPORT void Open_im_sdkSetUserListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkTransferGroupOwner(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable newOwnerUserID); + +FOUNDATION_EXPORT void Open_im_sdkTypingStatusUpdate(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable recvID, NSString* _Nullable msgTip); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkUploadImage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable token, NSString* _Nullable obj); + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Headers/Universe.objc.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Headers/Universe.objc.h new file mode 100644 index 0000000..019e750 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Headers/Universe.objc.h @@ -0,0 +1,29 @@ +// Objective-C API for talking to Go package. +// gobind -lang=objc +// +// File is generated by gobind. Do not edit. + +#ifndef __Universe_H__ +#define __Universe_H__ + +@import Foundation; +#include "ref.h" + +@protocol Universeerror; +@class Universeerror; + +@protocol Universeerror +- (NSString* _Nonnull)error; +@end + +@class Universeerror; + +@interface Universeerror : NSError { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (NSString* _Nonnull)error; +@end + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Headers/ref.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Headers/ref.h new file mode 100644 index 0000000..b8036a4 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Headers/ref.h @@ -0,0 +1,35 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#ifndef __GO_REF_HDR__ +#define __GO_REF_HDR__ + +#include + +// GoSeqRef is an object tagged with an integer for passing back and +// forth across the language boundary. A GoSeqRef may represent either +// an instance of a Go object, or an Objective-C object passed to Go. +// The explicit allocation of a GoSeqRef is used to pin a Go object +// when it is passed to Objective-C. The Go seq package maintains a +// reference to the Go object in a map keyed by the refnum along with +// a reference count. When the reference count reaches zero, the Go +// seq package will clear the corresponding entry in the map. +@interface GoSeqRef : NSObject { +} +@property(readonly) int32_t refnum; +@property(strong) id obj; // NULL when representing a Go object. + +// new GoSeqRef object to proxy a Go object. The refnum must be +// provided from Go side. +- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj; + +- (int32_t)incNum; + +@end + +@protocol goSeqRefInterface +-(GoSeqRef*) _ref; +@end + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Modules/module.modulemap b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Modules/module.modulemap new file mode 100644 index 0000000..6c7ae76 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Modules/module.modulemap @@ -0,0 +1,9 @@ +framework module "OpenIMCore" { + header "ref.h" + header "Open_im_sdk.objc.h" + header "Open_im_sdk_callback.objc.h" + header "Universe.objc.h" + header "OpenIMCore.h" + + export * +} \ No newline at end of file diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/OpenIMCore b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/OpenIMCore new file mode 100644 index 0000000..feca0c6 Binary files /dev/null and b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/OpenIMCore differ diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Resources/Info.plist b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Resources/Info.plist new file mode 100644 index 0000000..0d1a4b8 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/A/Resources/Info.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Headers/OpenIMCore.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Headers/OpenIMCore.h new file mode 100644 index 0000000..9534b48 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Headers/OpenIMCore.h @@ -0,0 +1,15 @@ + +// Objective-C API for talking to the following Go packages +// +// open_im_sdk/open_im_sdk +// open_im_sdk/open_im_sdk_callback +// +// File is generated by gomobile bind. Do not edit. +#ifndef __OpenIMCore_FRAMEWORK_H__ +#define __OpenIMCore_FRAMEWORK_H__ + +#include "Open_im_sdk.objc.h" +#include "Open_im_sdk_callback.objc.h" +#include "Universe.objc.h" + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Headers/Open_im_sdk.objc.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Headers/Open_im_sdk.objc.h new file mode 100644 index 0000000..7361321 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Headers/Open_im_sdk.objc.h @@ -0,0 +1,206 @@ +// Objective-C API for talking to open_im_sdk/open_im_sdk Go package. +// gobind -lang=objc open_im_sdk/open_im_sdk +// +// File is generated by gobind. Do not edit. + +#ifndef __Open_im_sdk_H__ +#define __Open_im_sdk_H__ + +@import Foundation; +#include "ref.h" +#include "Universe.objc.h" + +#include "Open_im_sdk_callback.objc.h" + +@interface Open_im_sdk : NSObject +// skipped variable UserRouterMap with unsupported type: map[string]*open_im_sdk/internal/login.LoginMgr + +// skipped variable UserSDKRwLock with unsupported type: sync.RWMutex + +@end + +FOUNDATION_EXPORT void Open_im_sdkAcceptFriendApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg); + +FOUNDATION_EXPORT void Open_im_sdkAcceptGroupApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg); + +FOUNDATION_EXPORT void Open_im_sdkAddBlack(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable blackUserID); + +FOUNDATION_EXPORT void Open_im_sdkAddFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDReqMsg); + +FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT BOOL Open_im_sdkCheckToken(NSString* _Nullable userID, NSString* _Nullable token, NSError* _Nullable* _Nullable error); + +FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID); + +FOUNDATION_EXPORT void Open_im_sdkClearGroupHistoryMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nullable operationID, NSString* _Nullable cardInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable operationID, NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable fileName); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable operationID, NSString* _Nullable fileBaseInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable fileFullPath, NSString* _Nullable fileName); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateForwardMessage(NSString* _Nullable operationID, NSString* _Nullable m); + +FOUNDATION_EXPORT void Open_im_sdkCreateGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupBaseInfo, NSString* _Nullable memberList); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessage(NSString* _Nullable operationID, NSString* _Nullable imagePath); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageByURL(NSString* _Nullable operationID, NSString* _Nullable sourcePicture, NSString* _Nullable bigPicture, NSString* _Nullable snapshotPicture); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateImageMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable imageFullPath); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateLocationMessage(NSString* _Nullable operationID, NSString* _Nullable description, double longitude, double latitude); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateMergerMessage(NSString* _Nullable operationID, NSString* _Nullable messageList, NSString* _Nullable title, NSString* _Nullable summaryList); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateQuoteMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable message); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessage(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageByURL(NSString* _Nullable operationID, NSString* _Nullable soundBaseInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateSoundMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable soundPath, int64_t duration); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextAtMessage(NSString* _Nullable operationID, NSString* _Nullable text, NSString* _Nullable atUserList); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateTextMessage(NSString* _Nullable operationID, NSString* _Nullable text); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessage(NSString* _Nullable operationID, NSString* _Nullable videoPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotPath); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageByURL(NSString* _Nullable operationID, NSString* _Nullable videoBaseInfo); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateVideoMessageFromFullPath(NSString* _Nullable operationID, NSString* _Nullable videoFullPath, NSString* _Nullable videoType, int64_t duration, NSString* _Nullable snapshotFullPath); + +FOUNDATION_EXPORT void Open_im_sdkDeleteConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID); + +FOUNDATION_EXPORT void Open_im_sdkDeleteFriend(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable friendUserID); + +FOUNDATION_EXPORT void Open_im_sdkDeleteMessageFromLocalStorage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message); + +FOUNDATION_EXPORT void Open_im_sdkGetAllConversationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetBlackList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetConversationIDBySessionType(NSString* _Nullable sourceID, long sessionType); + +FOUNDATION_EXPORT void Open_im_sdkGetConversationListSplit(id _Nullable callback, NSString* _Nullable operationID, long offset, long count); + +FOUNDATION_EXPORT void Open_im_sdkGetConversationRecvMessageOpt(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetDesignatedFriendsInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetFriendList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetGroupMemberList(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, int32_t filter, int32_t offset, int32_t count); + +FOUNDATION_EXPORT void Open_im_sdkGetGroupMembersInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetGroupsInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetHistoryMessageList(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable getMessageOptions); + +FOUNDATION_EXPORT void Open_im_sdkGetJoinedGroupList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT int32_t Open_im_sdkGetLoginStatus(void); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkGetLoginUser(void); + +FOUNDATION_EXPORT void Open_im_sdkGetMultipleConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList); + +FOUNDATION_EXPORT void Open_im_sdkGetOneConversation(id _Nullable callback, NSString* _Nullable operationID, long sessionType, NSString* _Nullable sourceID); + +FOUNDATION_EXPORT void Open_im_sdkGetRecvFriendApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetRecvGroupApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetSelfUserInfo(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetSendFriendApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetSendGroupApplicationList(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkGetTotalUnreadMsgCount(id _Nullable callback, NSString* _Nullable operationID); + +// skipped function GetUserWorker with unsupported parameter or return types + + +/** + * /////////////////////user///////////////////// + */ +FOUNDATION_EXPORT void Open_im_sdkGetUsersInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList); + +// skipped function InitOnce with unsupported parameter or return types + + +FOUNDATION_EXPORT BOOL Open_im_sdkInitSDK(id _Nullable listener, NSString* _Nullable operationID, NSString* _Nullable config); + +FOUNDATION_EXPORT void Open_im_sdkInsertSingleMessageToLocalStorage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable sendID); + +FOUNDATION_EXPORT void Open_im_sdkInviteUserToGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkJoinGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reqMsg); + +FOUNDATION_EXPORT void Open_im_sdkKickGroupMember(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable reason, NSString* _Nullable userIDList); + +FOUNDATION_EXPORT void Open_im_sdkLogin(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable token); + +FOUNDATION_EXPORT void Open_im_sdkLogout(id _Nullable callback, NSString* _Nullable operationID); + +FOUNDATION_EXPORT void Open_im_sdkMarkC2CMessageAsRead(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID, NSString* _Nullable msgIDList); + +FOUNDATION_EXPORT void Open_im_sdkMarkGroupMessageHasRead(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); + +FOUNDATION_EXPORT void Open_im_sdkPinConversation(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, BOOL isPinned); + +FOUNDATION_EXPORT void Open_im_sdkQuitGroup(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID); + +FOUNDATION_EXPORT void Open_im_sdkRefuseFriendApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDHandleMsg); + +FOUNDATION_EXPORT void Open_im_sdkRefuseGroupApplication(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable fromUserID, NSString* _Nullable handleMsg); + +FOUNDATION_EXPORT void Open_im_sdkRemoveBlack(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable removeUserID); + +FOUNDATION_EXPORT void Open_im_sdkRevokeMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkSdkVersion(void); + +FOUNDATION_EXPORT void Open_im_sdkSendMessage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo); + +FOUNDATION_EXPORT void Open_im_sdkSendMessageNotOss(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable message, NSString* _Nullable recvID, NSString* _Nullable groupID, NSString* _Nullable offlinePushInfo); + +FOUNDATION_EXPORT void Open_im_sdkSetAdvancedMsgListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkSetConversationDraft(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationID, NSString* _Nullable draftText); + +FOUNDATION_EXPORT void Open_im_sdkSetConversationListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkSetConversationRecvMessageOpt(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable conversationIDList, long opt); + +FOUNDATION_EXPORT void Open_im_sdkSetFriendListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkSetFriendRemark(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDRemark); + +FOUNDATION_EXPORT void Open_im_sdkSetGroupInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable groupInfo); + +/** + * ////////////////////////group////////////////////////////////////////// + */ +FOUNDATION_EXPORT void Open_im_sdkSetGroupListener(id _Nullable callback); + +FOUNDATION_EXPORT void Open_im_sdkSetSelfInfo(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userInfo); + +FOUNDATION_EXPORT void Open_im_sdkSetUserListener(id _Nullable listener); + +FOUNDATION_EXPORT void Open_im_sdkTransferGroupOwner(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable groupID, NSString* _Nullable newOwnerUserID); + +FOUNDATION_EXPORT void Open_im_sdkTypingStatusUpdate(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable recvID, NSString* _Nullable msgTip); + +FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkUploadImage(id _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable token, NSString* _Nullable obj); + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Headers/Universe.objc.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Headers/Universe.objc.h new file mode 100644 index 0000000..019e750 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Headers/Universe.objc.h @@ -0,0 +1,29 @@ +// Objective-C API for talking to Go package. +// gobind -lang=objc +// +// File is generated by gobind. Do not edit. + +#ifndef __Universe_H__ +#define __Universe_H__ + +@import Foundation; +#include "ref.h" + +@protocol Universeerror; +@class Universeerror; + +@protocol Universeerror +- (NSString* _Nonnull)error; +@end + +@class Universeerror; + +@interface Universeerror : NSError { +} +@property(strong, readonly) _Nonnull id _ref; + +- (nonnull instancetype)initWithRef:(_Nonnull id)ref; +- (NSString* _Nonnull)error; +@end + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Headers/ref.h b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Headers/ref.h new file mode 100644 index 0000000..b8036a4 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Headers/ref.h @@ -0,0 +1,35 @@ +// Copyright 2015 The Go Authors. All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +#ifndef __GO_REF_HDR__ +#define __GO_REF_HDR__ + +#include + +// GoSeqRef is an object tagged with an integer for passing back and +// forth across the language boundary. A GoSeqRef may represent either +// an instance of a Go object, or an Objective-C object passed to Go. +// The explicit allocation of a GoSeqRef is used to pin a Go object +// when it is passed to Objective-C. The Go seq package maintains a +// reference to the Go object in a map keyed by the refnum along with +// a reference count. When the reference count reaches zero, the Go +// seq package will clear the corresponding entry in the map. +@interface GoSeqRef : NSObject { +} +@property(readonly) int32_t refnum; +@property(strong) id obj; // NULL when representing a Go object. + +// new GoSeqRef object to proxy a Go object. The refnum must be +// provided from Go side. +- (instancetype)initWithRefnum:(int32_t)refnum obj:(id)obj; + +- (int32_t)incNum; + +@end + +@protocol goSeqRefInterface +-(GoSeqRef*) _ref; +@end + +#endif diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Modules/module.modulemap b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Modules/module.modulemap new file mode 100644 index 0000000..6c7ae76 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Modules/module.modulemap @@ -0,0 +1,9 @@ +framework module "OpenIMCore" { + header "ref.h" + header "Open_im_sdk.objc.h" + header "Open_im_sdk_callback.objc.h" + header "Universe.objc.h" + header "OpenIMCore.h" + + export * +} \ No newline at end of file diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/OpenIMCore b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/OpenIMCore new file mode 100644 index 0000000..feca0c6 Binary files /dev/null and b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/OpenIMCore differ diff --git a/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Resources/Info.plist b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Resources/Info.plist new file mode 100644 index 0000000..0d1a4b8 --- /dev/null +++ b/ios/Framework/OpenIMCore.xcframework/ios-arm64_x86_64-simulator/OpenIMCore.framework/Versions/Current/Resources/Info.plist @@ -0,0 +1,6 @@ + + + + + + diff --git a/lib/flutter_openim_sdk.dart b/lib/flutter_openim_sdk.dart index f11e81b..b3ab2ef 100644 --- a/lib/flutter_openim_sdk.dart +++ b/lib/flutter_openim_sdk.dart @@ -7,17 +7,19 @@ export 'src/enum/listener_type.dart'; export 'src/enum/message_status.dart'; export 'src/enum/message_type.dart'; export 'src/listener/advanced_msg_listener.dart'; +export 'src/listener/connect_listener.dart'; export 'src/listener/conversation_listener.dart'; export 'src/listener/friendship_listener.dart'; export 'src/listener/group_listener.dart'; export 'src/listener/impl/advanced_msg_listener.dart'; +export 'src/listener/impl/connect_listener.dart'; export 'src/listener/impl/conversation_listener.dart'; export 'src/listener/impl/friendship_listener.dart'; export 'src/listener/impl/group_listener.dart'; -export 'src/listener/impl/init_sdk_listener.dart'; export 'src/listener/impl/msg_send_progress_listener.dart'; -export 'src/listener/init_sdk_listener.dart'; +export 'src/listener/impl/user_listener.dart'; export 'src/listener/msg_send_progress_listener.dart'; +export 'src/listener/user_listener.dart'; export 'src/manager/im_conversation_manager.dart'; export 'src/manager/im_friendship_manager.dart'; export 'src/manager/im_group_manager.dart'; diff --git a/lib/src/enum/listener_type.dart b/lib/src/enum/listener_type.dart index 37e5495..61f34c7 100644 --- a/lib/src/enum/listener_type.dart +++ b/lib/src/enum/listener_type.dart @@ -1,10 +1,11 @@ class ListenerType { - static const simpleMsgListener = 'simpleMsgListener'; - static const initSDKListener = 'initSDKListener'; - static const groupListener = 'groupListener'; - static const advancedMsgListener = 'advancedMsgListener'; - static const conversationListener = 'conversationListener'; - static const friendListener = 'friendListener'; - static const signalingListener = 'signalingListener'; - static const msgSendProgressListener = "msgSendProgressListener"; + static final simpleMsgListener = 'simpleMsgListener'; + static final connectListener = 'connectListener'; + static final userListener = 'userListener'; + static final groupListener = 'groupListener'; + static final advancedMsgListener = 'advancedMsgListener'; + static final conversationListener = 'conversationListener'; + static final friendListener = 'friendListener'; + static final signalingListener = 'signalingListener'; + static final msgSendProgressListener = "msgSendProgressListener"; } diff --git a/lib/src/listener/init_sdk_listener.dart b/lib/src/listener/connect_listener.dart similarity index 74% rename from lib/src/listener/init_sdk_listener.dart rename to lib/src/listener/connect_listener.dart index 1251631..8ca1e83 100644 --- a/lib/src/listener/init_sdk_listener.dart +++ b/lib/src/listener/connect_listener.dart @@ -1,6 +1,4 @@ -import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; - -abstract class InitSDKListener { +abstract class ConnectListener { /// SDK is connecting to the server void connecting(); @@ -17,7 +15,4 @@ abstract class InitSDKListener { /// Ticket expired when online. /// At this time, you need to generate a new userSig and call IMManager's login() function to log in again void userSigExpired(); - - /// The information of the logged-in user has been updated - void selfInfoUpdated(UserInfo info); } diff --git a/lib/src/listener/friendship_listener.dart b/lib/src/listener/friendship_listener.dart index 2b520d0..8ad40c3 100644 --- a/lib/src/listener/friendship_listener.dart +++ b/lib/src/listener/friendship_listener.dart @@ -1,21 +1,21 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; abstract class FriendshipListener { - void blackListAdd(UserInfo u); + void friendApplicationAdded(FriendApplicationInfo u); - void blackListDeleted(UserInfo u); + void friendApplicationDeleted(FriendApplicationInfo u); - void friendApplicationListAccept(UserInfo u); + void friendApplicationAccepted(FriendApplicationInfo u); - void friendApplicationListAdded(UserInfo u); + void friendApplicationRejected(FriendApplicationInfo u); - void friendApplicationListDeleted(UserInfo u); + void friendAdded(FriendInfo u); - void friendApplicationListReject(UserInfo u); + void friendDeleted(FriendInfo u); - void friendInfoChanged(UserInfo u); + void friendInfoChanged(FriendInfo u); - void friendListAdded(UserInfo u); + void blacklistAdded(BlacklistInfo u); - void friendListDeleted(UserInfo u); + void blacklistDeleted(BlacklistInfo u); } diff --git a/lib/src/listener/group_listener.dart b/lib/src/listener/group_listener.dart index 78e7d00..5b55df3 100644 --- a/lib/src/listener/group_listener.dart +++ b/lib/src/listener/group_listener.dart @@ -1,23 +1,27 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; abstract class GroupListener { - void memberEnter(String groupId, List list); + void joinedGroupAdded(GroupInfo info); - void memberLeave(String groupId, GroupMembersInfo info); + void joinedGroupDeleted(GroupInfo info); - void memberInvited( - String groupId, GroupMembersInfo opUser, List list); + void groupMemberAdded(GroupMembersInfo info); - void memberKicked( - String groupId, GroupMembersInfo opUser, List list); + void groupMemberDeleted(GroupMembersInfo info); - void groupCreated(String groupId); + void receiveJoinGroupApplicationAdded(GroupApplicationInfo info); - void groupInfoChanged(String groupId, GroupInfo info); + void receiveJoinGroupApplicationDeleted(GroupApplicationInfo info); - void receiveJoinApplication( - String groupId, GroupMembersInfo info, String opReason); + void groupApplicationAdded(GroupApplicationInfo info); - void applicationProcessed(String groupId, GroupMembersInfo opUser, - int agreeOrReject, String opReason); + void groupApplicationDeleted(GroupApplicationInfo info); + + void groupInfoChanged(GroupInfo info); + + void groupMemberInfoChanged(GroupMembersInfo info); + + void groupApplicationAccepted(GroupApplicationInfo info); + + void groupApplicationRejected(GroupApplicationInfo info); } diff --git a/lib/src/listener/impl/init_sdk_listener.dart b/lib/src/listener/impl/connect_listener.dart similarity index 77% rename from lib/src/listener/impl/init_sdk_listener.dart rename to lib/src/listener/impl/connect_listener.dart index e2d7210..332e1fe 100644 --- a/lib/src/listener/impl/init_sdk_listener.dart +++ b/lib/src/listener/impl/connect_listener.dart @@ -1,19 +1,18 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; +import 'package:flutter_openim_sdk/src/listener/connect_listener.dart'; -class OnInitSDKListener extends InitSDKListener { +class OnConnectListener extends ConnectListener { Function(int? code, String? errorMsg)? onConnectFailed; Function()? onConnectSuccess; Function()? onConnecting; Function()? onKickedOffline; - Function(UserInfo info)? onSelfInfoUpdated; Function()? onUserSigExpired; - OnInitSDKListener({ + OnConnectListener({ this.onConnectFailed, this.onConnectSuccess, this.onConnecting, this.onKickedOffline, - this.onSelfInfoUpdated, this.onUserSigExpired, }); @@ -37,11 +36,6 @@ class OnInitSDKListener extends InitSDKListener { if (null != onKickedOffline) onKickedOffline!(); } - @override - void selfInfoUpdated(UserInfo info) { - if (null != onSelfInfoUpdated) onSelfInfoUpdated!(info); - } - @override void userSigExpired() { if (null != onUserSigExpired) onUserSigExpired!(); diff --git a/lib/src/listener/impl/friendship_listener.dart b/lib/src/listener/impl/friendship_listener.dart index 88d9057..1f26557 100644 --- a/lib/src/listener/impl/friendship_listener.dart +++ b/lib/src/listener/impl/friendship_listener.dart @@ -1,73 +1,93 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; +/// 申请添加好友: +/// 主动申请者收到 OnFriendApplicationAdded +/// 被添加者收到 OnFriendApplicationAdded +/// +/// 同意好友申请: +/// 操作者收到 OnFriendApplicationAccepted OnFriendAdded +/// 申请者收到 OnFriendApplicationAccepted OnFriendAdded +/// +/// 好友拒绝申请: +/// 操作者收到 OnFriendApplicationRejected +/// 申请者收到 OnFriendApplicationRejected +/// +/// 删除好友: +/// 操作者收到 OnFriendDeleted +/// +/// 修改备注: +/// 操作者收到 OnFriendInfoChanged +/// +/// 添加黑名单: +/// 操作者收到 OnBlacklistAdded; +/// +/// 移除黑名单: +/// 操作者收到 OnBlacklistDeleted class OnFriendshipListener extends FriendshipListener { - Function(UserInfo u)? onBlackListAdd; - Function(UserInfo u)? onBlackListDeleted; - Function(UserInfo u)? onFriendApplicationListAccept; - Function(UserInfo u)? onFriendApplicationListAdded; - Function(UserInfo u)? onFriendApplicationListDeleted; - Function(UserInfo u)? onFriendApplicationListReject; - Function(UserInfo u)? onFriendInfoChanged; - Function(UserInfo u)? onFriendListAdded; - Function(UserInfo u)? onFriendListDeleted; + Function(FriendApplicationInfo i)? onFriendApplicationAdded; + Function(FriendApplicationInfo i)? onFriendApplicationDeleted; + Function(FriendApplicationInfo i)? onFriendApplicationAccepted; + Function(FriendApplicationInfo i)? onFriendApplicationRejected; + Function(FriendInfo i)? onFriendAdded; + Function(FriendInfo i)? onFriendDeleted; + Function(FriendInfo i)? onFriendInfoChanged; + Function(BlacklistInfo i)? onBlacklistAdded; + Function(BlacklistInfo i)? onBlacklistDeleted; OnFriendshipListener({ - this.onBlackListAdd, - this.onBlackListDeleted, - this.onFriendApplicationListAccept, - this.onFriendApplicationListAdded, - this.onFriendApplicationListDeleted, - this.onFriendApplicationListReject, + this.onBlacklistAdded, + this.onBlacklistDeleted, + this.onFriendAdded, + this.onFriendApplicationAccepted, + this.onFriendApplicationAdded, + this.onFriendApplicationDeleted, + this.onFriendApplicationRejected, + this.onFriendDeleted, this.onFriendInfoChanged, - this.onFriendListAdded, - this.onFriendListDeleted, }); @override - void blackListAdd(UserInfo u) { - if (null != onBlackListAdd) onBlackListAdd!(u); + void blacklistAdded(BlacklistInfo u) { + onBlacklistAdded?.call(u); } @override - void blackListDeleted(UserInfo u) { - if (null != onBlackListDeleted) onBlackListDeleted!(u); + void blacklistDeleted(BlacklistInfo u) { + onBlacklistDeleted?.call(u); } @override - void friendApplicationListAccept(UserInfo u) { - if (null != onFriendApplicationListAccept) - onFriendApplicationListAccept!(u); + void friendAdded(FriendInfo u) { + onFriendAdded?.call(u); } @override - void friendApplicationListAdded(UserInfo u) { - if (null != onFriendApplicationListAdded) onFriendApplicationListAdded!(u); + void friendApplicationAccepted(FriendApplicationInfo u) { + onFriendApplicationAccepted?.call(u); } @override - void friendApplicationListDeleted(UserInfo u) { - if (null != onFriendApplicationListDeleted) - onFriendApplicationListDeleted!(u); + void friendApplicationAdded(FriendApplicationInfo u) { + onFriendApplicationAdded?.call(u); } @override - void friendApplicationListReject(UserInfo u) { - if (null != onFriendApplicationListReject) - onFriendApplicationListReject!(u); + void friendApplicationDeleted(FriendApplicationInfo u) { + onFriendApplicationDeleted?.call(u); } @override - void friendInfoChanged(UserInfo u) { - if (null != onFriendInfoChanged) onFriendInfoChanged!(u); + void friendApplicationRejected(FriendApplicationInfo u) { + onFriendApplicationRejected?.call(u); } @override - void friendListAdded(UserInfo u) { - if (null != onFriendListAdded) onFriendListAdded!(u); + void friendDeleted(FriendInfo u) { + onFriendDeleted?.call(u); } @override - void friendListDeleted(UserInfo u) { - if (null != onFriendListDeleted) onFriendListDeleted!(u); + void friendInfoChanged(FriendInfo u) { + onFriendInfoChanged?.call(u); } } diff --git a/lib/src/listener/impl/group_listener.dart b/lib/src/listener/impl/group_listener.dart index b5b05a8..77d3ae1 100644 --- a/lib/src/listener/impl/group_listener.dart +++ b/lib/src/listener/impl/group_listener.dart @@ -1,75 +1,121 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; +/// 创建群: +/// 初始成员收到 OnJoinedGroupAdded +/// +/// 退出群: +/// 退出者收到 OnJoinedGroupDeleted +/// 群成员收到 OnGroupMemberDeleted +/// +/// 踢出群: +/// 被踢者收到 OnJoinedGroupDeleted +/// 群成员收到 OnGroupMemberDeleted +/// +/// 邀请进群: +/// 被邀请者收到 OnJoinedGroupAdded +/// 群成员(不包括被邀请者)收到 OnGroupMemberAdded +/// +/// 申请加群: +/// 申请者收到 OnGroupApplicationAdded +/// 群主+管理员收到 OnReceiveJoinGroupApplicationAdded +/// +/// 同意进群: +/// 申请者收到 OnJoinedGroupAdded OnGroupApplicationAccepted +/// 群成员(不包括申请者)收到 OnGroupMemberAdded +/// 审批者(群主或者管理员)收到 OnGroupMemberAdded OnGroupApplicationAccepted +/// +/// 拒绝进群: +/// 申请者收到 OnGroupApplicationRejected; +/// 审批者(群主或者管理员)收到 OnGroupApplicationRejected +/// +/// 修改群资料: +/// 群成员收到 OnGroupInfoChanged class OnGroupListener extends GroupListener { - Function(String groupId, GroupMembersInfo opUser, int agreeOrReject, - String opReason)? onApplicationProcessed; - Function(String groupId)? onGroupCreated; - Function(String groupId, GroupInfo info)? onGroupInfoChanged; - Function(String groupId, List list)? onMemberEnter; - Function( - String groupId, GroupMembersInfo opUser, List list)? - onMemberInvited; - Function( - String groupId, GroupMembersInfo opUser, List list)? - onMemberKicked; - Function(String groupId, GroupMembersInfo info)? onMemberLeave; - Function(String groupId, GroupMembersInfo info, String opReason)? - onReceiveJoinApplication; + Function(GroupApplicationInfo info)? onGroupApplicationAccepted; + Function(GroupApplicationInfo info)? onGroupApplicationAdded; + Function(GroupApplicationInfo info)? onGroupApplicationDeleted; + Function(GroupApplicationInfo info)? onGroupApplicationRejected; + Function(GroupInfo info)? onGroupInfoChanged; + Function(GroupMembersInfo info)? onGroupMemberAdded; + Function(GroupMembersInfo info)? onGroupMemberDeleted; + Function(GroupMembersInfo info)? onGroupMemberInfoChanged; + Function(GroupInfo info)? onJoinedGroupAdded; + Function(GroupInfo info)? onJoinedGroupDeleted; + Function(GroupApplicationInfo info)? onReceiveJoinGroupApplicationAdded; + Function(GroupApplicationInfo info)? onReceiveJoinGroupApplicationDeleted; OnGroupListener({ - this.onApplicationProcessed, - this.onGroupCreated, + this.onGroupApplicationAccepted, + this.onGroupApplicationAdded, + this.onGroupApplicationDeleted, + this.onGroupApplicationRejected, this.onGroupInfoChanged, - this.onMemberEnter, - this.onMemberInvited, - this.onMemberKicked, - this.onMemberLeave, - this.onReceiveJoinApplication, + this.onGroupMemberAdded, + this.onGroupMemberDeleted, + this.onGroupMemberInfoChanged, + this.onJoinedGroupAdded, + this.onJoinedGroupDeleted, + this.onReceiveJoinGroupApplicationAdded, + this.onReceiveJoinGroupApplicationDeleted, }); @override - void applicationProcessed(String groupId, GroupMembersInfo opUser, - int agreeOrReject, String opReason) { - if (null != onApplicationProcessed) - onApplicationProcessed!(groupId, opUser, agreeOrReject, opReason); + void groupApplicationAccepted(GroupApplicationInfo info) { + onGroupApplicationAccepted?.call(info); } @override - void groupCreated(String groupId) { - if (null != onGroupCreated) onGroupCreated!(groupId); + void groupApplicationAdded(GroupApplicationInfo info) { + onGroupApplicationAdded?.call(info); } @override - void groupInfoChanged(String groupId, GroupInfo info) { - if (null != onGroupInfoChanged) onGroupInfoChanged!(groupId, info); + void groupApplicationDeleted(GroupApplicationInfo info) { + onGroupApplicationDeleted?.call(info); } @override - void memberEnter(String groupId, List list) { - if (null != onMemberEnter) onMemberEnter!(groupId, list); + void groupApplicationRejected(GroupApplicationInfo info) { + onGroupApplicationRejected?.call(info); } @override - void memberInvited( - String groupId, GroupMembersInfo opUser, List list) { - if (null != onMemberInvited) onMemberInvited!(groupId, opUser, list); + void groupInfoChanged(GroupInfo info) { + onGroupInfoChanged?.call(info); } @override - void memberKicked( - String groupId, GroupMembersInfo opUser, List list) { - if (null != onMemberKicked) onMemberKicked!(groupId, opUser, list); + void groupMemberAdded(GroupMembersInfo info) { + onGroupMemberAdded?.call(info); } @override - void memberLeave(String groupId, GroupMembersInfo info) { - if (null != onMemberLeave) onMemberLeave!(groupId, info); + void groupMemberDeleted(GroupMembersInfo info) { + onGroupMemberDeleted?.call(info); } @override - void receiveJoinApplication( - String groupId, GroupMembersInfo info, String opReason) { - if (null != onReceiveJoinApplication) - onReceiveJoinApplication!(groupId, info, opReason); + void groupMemberInfoChanged(GroupMembersInfo info) { + onGroupMemberInfoChanged?.call(info); + } + + @override + void joinedGroupAdded(GroupInfo info) { + onJoinedGroupAdded?.call(info); + } + + @override + void joinedGroupDeleted(GroupInfo info) { + onJoinedGroupDeleted?.call(info); + } + + @override + void receiveJoinGroupApplicationAdded(GroupApplicationInfo info) { + onReceiveJoinGroupApplicationAdded?.call(info); + } + + @override + void receiveJoinGroupApplicationDeleted(GroupApplicationInfo info) { + onReceiveJoinGroupApplicationDeleted?.call(info); } } diff --git a/lib/src/listener/impl/msg_send_progress_listener.dart b/lib/src/listener/impl/msg_send_progress_listener.dart index 7bda19f..f90de43 100644 --- a/lib/src/listener/impl/msg_send_progress_listener.dart +++ b/lib/src/listener/impl/msg_send_progress_listener.dart @@ -1,11 +1,11 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; class OnMsgSendProgressListener extends MsgSendProgressListener { - Function(String msgID, int progress)? onProgress; + Function(String clientMsgID, int progress)? onProgress; OnMsgSendProgressListener({this.onProgress}); - void progress(String msgID, int progress) { - if (null != onProgress) onProgress!(msgID, progress); + void progress(String clientMsgID, int progress) { + if (null != onProgress) onProgress!(clientMsgID, progress); } } diff --git a/lib/src/listener/impl/user_listener.dart b/lib/src/listener/impl/user_listener.dart new file mode 100644 index 0000000..230eeb4 --- /dev/null +++ b/lib/src/listener/impl/user_listener.dart @@ -0,0 +1,12 @@ +import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; + +class OnUserListener extends UserListener { + Function(UserInfo info)? onSelfInfoUpdated; + + OnUserListener({this.onSelfInfoUpdated}); + + @override + void selfInfoUpdated(UserInfo info) { + onSelfInfoUpdated?.call(info); + } +} diff --git a/lib/src/listener/msg_send_progress_listener.dart b/lib/src/listener/msg_send_progress_listener.dart index 378f73a..f1dd4f3 100644 --- a/lib/src/listener/msg_send_progress_listener.dart +++ b/lib/src/listener/msg_send_progress_listener.dart @@ -1,3 +1,3 @@ abstract class MsgSendProgressListener { - void progress(String msgID, int progress); + void progress(String clientMsgID, int progress); } diff --git a/lib/src/listener/user_listener.dart b/lib/src/listener/user_listener.dart new file mode 100644 index 0000000..0d830c6 --- /dev/null +++ b/lib/src/listener/user_listener.dart @@ -0,0 +1,6 @@ +import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; + +abstract class UserListener { + /// The information of the logged-in user has been updated + void selfInfoUpdated(UserInfo info); +} diff --git a/lib/src/manager/im_conversation_manager.dart b/lib/src/manager/im_conversation_manager.dart index c319f38..199e5c1 100644 --- a/lib/src/manager/im_conversation_manager.dart +++ b/lib/src/manager/im_conversation_manager.dart @@ -20,15 +20,22 @@ class ConversationManager { /// Get all conversations /// 获取所有会话 - Future> getAllConversationList() => _channel - .invokeMethod('getAllConversationList', _buildParam({})) - .then((value) => _toList(value)); + Future> getAllConversationList( + {String? operationID}) => + _channel + .invokeMethod( + 'getAllConversationList', + _buildParam({ + "operationID": _checkOperationID(operationID), + })) + .then((value) => _toList(value)); /// Paging to get conversation - /// 分页获取会话, [offset]下次获取开始index + /// 分页获取会话 Future> getConversationListSplit({ int offset = 0, int count = 20, + String? operationID, }) => _channel .invokeMethod( @@ -36,18 +43,20 @@ class ConversationManager { _buildParam({ 'offset': offset, 'count': count, + "operationID": _checkOperationID(operationID), })) .then((value) => _toList(value)); - /// Get a single conversation info - /// [sourceID] if it is a single chat, Its value is userID. if it is a group chat, Its value is groupID - /// [sessionType] if it is a single chat, it value is 1. if it is a group chat, it value is 2 - /// 获取单个会话 - /// [sourceID]如果是单聊值传用户id,如果是群聊值传组id - /// [sessionType]如果是单聊值传1,如果是群聊值传2 - Future getSingleConversation({ + /// Get a conversation, if it doesn't exist it will be created automatically + /// [sourceID] if it is a single chat, Its value is userID. if it is a group chat, Its value is groupID + /// [sessionType] if it is a single chat, it value is 1. if it is a group chat, it value is 2 + /// 获取一个会话,如果不存在会自动创建 + /// [sourceID] 如果是单聊值传用户ID,如果是群聊值传组ID + /// [sessionType] 如果是单聊值传1,如果是群聊值传2 + Future getOneConversation({ required String sourceID, required int sessionType, + String? operationID, }) => _channel .invokeMethod( @@ -55,6 +64,7 @@ class ConversationManager { _buildParam({ "sourceID": sourceID, "sessionType": sessionType, + "operationID": _checkOperationID(operationID), })) .then((value) => _toObj(value)); @@ -62,12 +72,14 @@ class ConversationManager { /// 获取多个会话 Future> getMultipleConversation({ required List conversationIDList, + String? operationID, }) => _channel .invokeMethod( 'getMultipleConversation', _buildParam({ "conversationIDList": conversationIDList, + "operationID": _checkOperationID(operationID), })) .then((value) => _toList(value)); @@ -75,12 +87,14 @@ class ConversationManager { /// 删除会话 Future deleteConversation({ required String conversationID, + String? operationID, }) => _channel .invokeMethod( 'deleteConversation', _buildParam({ "conversationID": conversationID, + "operationID": _checkOperationID(operationID), })) .then((value) => _printValue(value)); @@ -89,6 +103,7 @@ class ConversationManager { Future setConversationDraft({ required String conversationID, required String draftText, + String? operationID, }) => _channel .invokeMethod( @@ -96,6 +111,7 @@ class ConversationManager { _buildParam({ "conversationID": conversationID, "draftText": draftText, + "operationID": _checkOperationID(operationID), })) .then((value) => _printValue(value)); @@ -104,6 +120,7 @@ class ConversationManager { Future pinConversation({ required String conversationID, required bool isPinned, + String? operationID, }) => _channel .invokeMethod( @@ -111,33 +128,47 @@ class ConversationManager { _buildParam({ "conversationID": conversationID, "isPinned": isPinned, + "operationID": _checkOperationID(operationID), })) .then((value) => _printValue(value)); /// Mark single chat messages as read /// 标记单聊已读 - Future markSingleMessageHasRead({required String userID}) => - _channel.invokeMethod( - 'markSingleMessageHasRead', _buildParam({'userID': userID})); + // Future markSingleMessageHasRead({required String userID}) => + // _channel.invokeMethod( + // 'markSingleMessageHasRead', _buildParam({'userID': userID})); /// Mark group chat messages as read /// 标记群聊已读 - Future markGroupMessageHasRead({required String groupID}) => + Future markGroupMessageHasRead({ + required String groupID, + String? operationID, + }) => _channel.invokeMethod( - 'markGroupMessageHasRead', _buildParam({'groupID': groupID})); + 'markGroupMessageHasRead', + _buildParam({ + 'groupID': groupID, + "operationID": _checkOperationID(operationID), + })); /// Get the total number of unread messages /// 获取未读消息总数 - Future getTotalUnreadMsgCount() => - _channel.invokeMethod('getTotalUnreadMsgCount', _buildParam({})); + Future getTotalUnreadMsgCount({ + String? operationID, + }) => + _channel.invokeMethod( + 'getTotalUnreadMsgCount', + _buildParam({ + "operationID": _checkOperationID(operationID), + })); /// Query conversation id - /// [sourceID] : if it is a single chat, Its value is userID. if it is a group chat, Its value is groupID - /// [sessionType] : if it is a single chat, it value is 1. if it is a group chat, it value is 2 + /// [sourceID] if it is a single chat, Its value is userID. if it is a group chat, Its value is groupID + /// [sessionType] if it is a single chat, it value is 1. if it is a group chat, it value is 2 /// 查询会话id - /// [sourceID]如果是单聊值传用户id,如果是群聊值传组id - /// [sessionType]如果是单聊值传1,如果是群聊值传2 - Future getConversationID({ + /// [sourceID] 如果是单聊值传用户ID,如果是群聊值传组ID + /// [sessionType] 如果是单聊值传1,如果是群聊值传2 + Future getConversationIDBySessionType({ required String sourceID, required int sessionType, }) => @@ -149,18 +180,20 @@ class ConversationManager { })); /// Message Do Not Disturb - /// [status] 1: Do not receive messages, 2: Do not notify when messages are received; 0: Normal + /// [status] 1: Do not receive messages. 2: Do not notify when messages are received. 0: Normal. /// 消息免打扰设置 /// [status] 1:不接受消息;2:接受在线消息不接受离线消息;3:正常 Future setConversationRecvMessageOpt({ required List conversationIDList, required int status, + String? operationID, }) => _channel.invokeMethod( 'setConversationRecvMessageOpt', _buildParam({ "conversationIDList": conversationIDList, "status": status, + "operationID": _checkOperationID(operationID), })); /// Message Do Not Disturb @@ -168,12 +201,14 @@ class ConversationManager { /// 查询免打扰状态 Future> getConversationRecvMessageOpt({ required List conversationIDList, + String? operationID, }) => _channel .invokeMethod( 'getConversationRecvMessageOpt', _buildParam({ "conversationIDList": conversationIDList, + "operationID": _checkOperationID(operationID), })) .then((value) => _formatJson(value)); @@ -181,13 +216,13 @@ class ConversationManager { /// 会话列表自定义排序规则 List simpleSort(List list) => list ..sort((a, b) { - if ((a.isPinned == 1 && b.isPinned == 1) || - (a.isPinned != 1 && b.isPinned != 1)) { - int aCompare = a.draftTimestamp! > a.latestMsgSendTime! - ? a.draftTimestamp! + if ((a.isPinned == true && b.isPinned == true) || + (a.isPinned != true && b.isPinned != true)) { + int aCompare = a.draftTextTime! > a.latestMsgSendTime! + ? a.draftTextTime! : a.latestMsgSendTime!; - int bCompare = b.draftTimestamp! > b.latestMsgSendTime! - ? b.draftTimestamp! + int bCompare = b.draftTextTime! > b.latestMsgSendTime! + ? b.draftTextTime! : b.latestMsgSendTime!; if (aCompare > bCompare) { return -1; @@ -196,7 +231,7 @@ class ConversationManager { } else { return 0; } - } else if (a.isPinned == 1 && b.isPinned != 1) { + } else if (a.isPinned == true && b.isPinned != true) { return -1; } else { return 1; @@ -222,4 +257,8 @@ class ConversationManager { static String _printValue(value) { return value; } + + static String _checkOperationID(String? obj) { + return obj ?? DateTime.now().millisecondsSinceEpoch.toString(); + } } diff --git a/lib/src/manager/im_friendship_manager.dart b/lib/src/manager/im_friendship_manager.dart index 96c406c..8410648 100644 --- a/lib/src/manager/im_friendship_manager.dart +++ b/lib/src/manager/im_friendship_manager.dart @@ -18,82 +18,189 @@ class FriendshipManager { /// Get friend info by user id /// 查询好友信息 - Future> getFriendsInfo({required List uidList}) => + Future> getFriendsInfo({ + required List uidList, + String? operationID, + }) => _channel - .invokeMethod('getFriendsInfo', _buildParam({"uidList": uidList})) - .then((value) => _toList(value)); + .invokeMethod( + 'getFriendsInfo', + _buildParam({ + "uidList": uidList, + "operationID": _checkOperationID(operationID), + })) + .then((value) => _toList(value, (v) => UserInfo.fromJson(v.cast()))); /// Send an friend application /// 发送一个好友请求 - Future addFriend({required String uid, required String reason}) => + Future addFriend({ + required String uid, + String? reason, + String? operationID, + }) => _channel.invokeMethod( - 'addFriend', _buildParam({"uid": uid, "reqMessage": reason})); + 'addFriend', + _buildParam({ + "toUserID": uid, + "reqMsg": reason, + "operationID": _checkOperationID(operationID), + })); - /// Get all friend application, sent to you by others - /// 获取所有好友申请 - Future> getFriendApplicationList() => _channel - .invokeMethod('getFriendApplicationList', _buildParam({})) - .then((value) => _toList(value)); + /// Get someone's request to add me as a friend + /// 获取别人加我为好友的申请 + Future> getRecvFriendApplicationList( + {String? operationID}) => + _channel + .invokeMethod( + 'getRecvFriendApplicationList', + _buildParam({ + "operationID": _checkOperationID(operationID), + })) + .then((value) => + _toList(value, (v) => FriendApplicationInfo.fromJson(v.cast()))); + + /// Get friend requests from me + /// 获取我发出的好友申请 + Future> getSendFriendApplicationList( + {String? operationID}) => + _channel + .invokeMethod( + 'getSendFriendApplicationList', + _buildParam({ + "operationID": _checkOperationID(operationID), + })) + .then((value) => + _toList(value, (v) => FriendApplicationInfo.fromJson(v.cast()))); /// Find all friends including those who have been added to the blacklist /// 获取好友列表包含已拉入黑名单的好友 - Future> getFriendList() => _channel - .invokeMethod('getFriendList', _buildParam({})) - .then((value) => _toList(value)); + Future> getFriendList({String? operationID}) => _channel + .invokeMethod( + 'getFriendList', + _buildParam({ + "operationID": _checkOperationID(operationID), + })) + .then((value) => _toList(value, (v) => UserInfo.fromJson(v.cast()))); /// Find all friends including those who have been added to the blacklist /// 获取好友列表 - Future> getFriendListMap() => _channel - .invokeMethod('getFriendList', _buildParam({})) + Future> getFriendListMap({String? operationID}) => _channel + .invokeMethod( + 'getFriendList', + _buildParam({ + "operationID": _checkOperationID(operationID), + })) .then((value) => _toListMap(value)); /// Modify friend information, only [comment] can be modified /// 设置好友备注 - Future setFriendInfo( - {required String uid, required String comment}) => + Future setFriendRemark({ + required String uid, + required String remark, + String? operationID, + }) => _channel.invokeMethod( - 'setFriendInfo', + 'setFriendRemark', _buildParam({ - 'uid': uid, - 'comment': comment, + 'toUserID': uid, + 'remark': remark, + "operationID": _checkOperationID(operationID), })); /// Add friends to blacklist /// 加入黑名单 - Future addToBlackList({required String uid}) => - _channel.invokeMethod('addToBlackList', _buildParam({"uid": uid})); + Future addBlacklist({ + required String uid, + String? operationID, + }) => + _channel.invokeMethod( + 'addBlacklist', + _buildParam({ + "uid": uid, + "operationID": _checkOperationID(operationID), + })); /// Find all blacklist /// 获取黑名单列表 - Future> getBlackList() => _channel - .invokeMethod('getBlackList', _buildParam({})) - .then((value) => _toList(value)); + Future> getBlacklist({String? operationID}) => _channel + .invokeMethod( + 'getBlacklist', + _buildParam({ + "operationID": _checkOperationID(operationID), + })) + .then((value) => _toList(value, (v) => UserInfo.fromJson(v.cast()))); /// Remove from blacklist /// 从黑名单移除 - Future deleteFromBlackList({required String uid}) => - _channel.invokeMethod('deleteFromBlackList', _buildParam({"uid": uid})); + Future removeBlacklist({ + required String uid, + String? operationID, + }) => + _channel.invokeMethod( + 'removeBlacklist', + _buildParam({ + "uid": uid, + "operationID": _checkOperationID(operationID), + })); /// Determine if there is a friendship by userId /// 检查友好关系 - Future> checkFriend(List uidList) => _channel - .invokeMethod('checkFriend', _buildParam({'uidList': uidList})) - .then((value) => _toList(value)); + Future> checkFriend({ + required List uidList, + String? operationID, + }) => + _channel + .invokeMethod( + 'checkFriend', + _buildParam({ + 'uidList': uidList, + "operationID": _checkOperationID(operationID), + })) + .then((value) => + _toList(value, (v) => FriendshipInfo.fromJson(v.cast()))); /// Dissolve friendship from friend list /// 删除好友 - Future deleteFromFriendList({required String uid}) => - _channel.invokeMethod('deleteFromFriendList', _buildParam({"uid": uid})); + Future deleteFriend({ + required String uid, + String? operationID, + }) => + _channel.invokeMethod( + 'deleteFriend', + _buildParam({ + "uid": uid, + "operationID": _checkOperationID(operationID), + })); /// Accept application of be friend /// 接受好友请求 - Future acceptFriendApplication({required String uid}) => _channel - .invokeMethod('acceptFriendApplication', _buildParam({"uid": uid})); + Future acceptFriendApplication({ + required String uid, + String? handleMsg, + String? operationID, + }) => + _channel.invokeMethod( + 'acceptFriendApplication', + _buildParam({ + "toUserID": uid, + "handleMsg": handleMsg, + "operationID": _checkOperationID(operationID), + })); /// Refuse application of be friend /// 拒绝好友请求 - Future refuseFriendApplication({required String uid}) => _channel - .invokeMethod('refuseFriendApplication', _buildParam({"uid": uid})); + Future refuseFriendApplication({ + required String uid, + String? handleMsg, + String? operationID, + }) => + _channel.invokeMethod( + 'refuseFriendApplication', + _buildParam({ + "toUserID": uid, + "handleMsg": handleMsg, + "operationID": _checkOperationID(operationID), + })); /// // Future forceSyncFriendApplication() { @@ -115,10 +222,10 @@ class FriendshipManager { return param; } - static List _toList(String? value) { + static List _toList(String? value, T f(Map map)) { var list = _formatJson(value); - if (null == list) return []; - return (list as List).map((e) => UserInfo.fromJson(e)).toList(); + if (null == list) return []; + return (list as List).map((e) => f(e)).toList(); } static List _toListMap(String? value) { @@ -133,4 +240,8 @@ class FriendshipManager { static String _printValue(value) { return value; } + + static String _checkOperationID(String? obj) { + return obj ?? DateTime.now().millisecondsSinceEpoch.toString(); + } } diff --git a/lib/src/manager/im_group_manager.dart b/lib/src/manager/im_group_manager.dart index 9c08801..793adaf 100644 --- a/lib/src/manager/im_group_manager.dart +++ b/lib/src/manager/im_group_manager.dart @@ -23,6 +23,7 @@ class GroupManager { required String groupId, required List uidList, String? reason, + String? operationID, }) => _channel .invokeMethod( @@ -31,6 +32,7 @@ class GroupManager { 'gid': groupId, 'reason': reason, 'uidList': uidList, + "operationID": _checkOperationID(operationID), })) .then((value) => (_formatJson(value) as List) .map((e) => GroupInviteResult.fromJson(e)) @@ -42,6 +44,7 @@ class GroupManager { required String groupId, required List uidList, String? reason, + String? operationID, }) => _channel .invokeMethod( @@ -50,6 +53,7 @@ class GroupManager { 'gid': groupId, 'reason': reason, 'uidList': uidList, + "operationID": _checkOperationID(operationID), })) .then((value) => (_formatJson(value) as List) .map((e) => GroupInviteResult.fromJson(e)) @@ -60,6 +64,7 @@ class GroupManager { Future> getGroupMembersInfo({ required String groupId, required List uidList, + String? operationID, }) => _channel .invokeMethod( @@ -67,19 +72,20 @@ class GroupManager { _buildParam({ 'gid': groupId, 'uidList': uidList, + "operationID": _checkOperationID(operationID), })) .then((value) => (_formatJson(value) as List) .map((e) => GroupMembersInfo.fromJson(e)) .toList()); /// Get the list of group members - /// [filter] 0: all user, 1: group owner, 2: administrator - /// [next] begin index, pull and fill 0 for the first time - /// 获取组成员列表 - Future getGroupMemberList({ + /// 分页获取组成员列表 + Future> getGroupMemberList({ required String groupId, int filter = 0, - int next = 0, + int offset = 0, + int count = 0, + String? operationID, }) => _channel .invokeMethod( @@ -87,16 +93,22 @@ class GroupManager { _buildParam({ 'gid': groupId, 'filter': filter, - 'next': next, + 'offset': offset, + 'count': count, + 'operationID': _checkOperationID(operationID), })) - .then((value) => GroupMembersList.fromJson(_formatJson(value))); + .then((value) => (_formatJson(value) as List) + .map((e) => GroupMembersInfo.fromJson(e)) + .toList()); /// Get the list of group members - /// 获取组成员列表 + /// 分页获取组成员列表 Future getGroupMemberListMap({ required String groupId, int filter = 0, - int next = 0, + int offset = 0, + int count = 0, + String? operationID, }) => _channel .invokeMethod( @@ -104,49 +116,72 @@ class GroupManager { _buildParam({ 'gid': groupId, 'filter': filter, - 'next': next, + 'offset': offset, + 'count': count, + 'operationID': _checkOperationID(operationID), })) .then((value) => _formatJson(value)); /// Find all groups you have joined /// 查询已加入的组列表 - Future> getJoinedGroupList() => _channel - .invokeMethod('getJoinedGroupList', _buildParam({})) + Future> getJoinedGroupList({String? operationID}) => _channel + .invokeMethod( + 'getJoinedGroupList', + _buildParam({ + 'operationID': _checkOperationID(operationID), + })) .then((value) => (_formatJson(value) as List) .map((e) => GroupInfo.fromJson(e)) .toList()); /// Find all groups you have joined /// 查询已加入的组列表 - Future> getJoinedGroupListMap() => _channel - .invokeMethod('getJoinedGroupList', _buildParam({})) + Future> getJoinedGroupListMap({String? operationID}) => _channel + .invokeMethod( + 'getJoinedGroupList', + _buildParam({ + 'operationID': _checkOperationID(operationID), + })) .then((value) => _formatJson(value)); /// Check if you are a member of the group /// 检查是否已加入组 - Future isJoinedGroup({required String gid}) => getJoinedGroupList() - .then((list) => list.where((e) => e.groupID == gid).length > 0); + Future isJoinedGroup({ + required String gid, + String? operationID, + }) => + getJoinedGroupList( + operationID: _checkOperationID(operationID), + ).then((list) => list.where((e) => e.groupID == gid).length > 0); /// Create a group /// 创建一个组 - Future createGroup({ + Future createGroup({ String? groupName, String? notification, String? introduction, String? faceUrl, + int? groupType, + String? ex, required List list, + String? operationID, }) => - _channel.invokeMethod( - 'createGroup', - _buildParam({ - 'gInfo': { - "groupName": groupName, - "notification": notification, - "introduction": introduction, - "faceUrl": faceUrl, - }, - 'memberList': list.map((e) => e.toJson()).toList() - })); + _channel + .invokeMethod( + 'createGroup', + _buildParam({ + 'gInfo': { + "groupName": groupName, + "notification": notification, + "introduction": introduction, + "faceURL": faceUrl, + "groupType": groupType, + "ex": ex, + }, + 'memberList': list.map((e) => e.toJson()).toList(), + 'operationID': _checkOperationID(operationID), + })) + .then((value) => GroupInfo.fromJson(_formatJson(value))); /// Edit group information /// 编辑组资料 @@ -156,26 +191,37 @@ class GroupManager { String? notification, String? introduction, String? faceUrl, + String? ex, + String? operationID, }) => _channel.invokeMethod( 'setGroupInfo', _buildParam({ + "gid": groupID, 'gInfo': { - "groupID": groupID, + // "groupID": groupID, "groupName": groupName, "notification": notification, "introduction": introduction, - "faceUrl": faceUrl, + "faceURL": faceUrl, + "ex": ex, }, + 'operationID': _checkOperationID(operationID), })); /// Find group information by group id /// 查询组信息 Future> getGroupsInfo({ required List gidList, + String? operationID, }) => _channel - .invokeMethod('getGroupsInfo', _buildParam({'gidList': gidList})) + .invokeMethod( + 'getGroupsInfo', + _buildParam({ + 'gidList': gidList, + 'operationID': _checkOperationID(operationID), + })) .then((value) { List list = _formatJson(value); return list.map((e) => GroupInfo.fromJson(e)).toList(); @@ -186,23 +232,27 @@ class GroupManager { Future joinGroup({ required String gid, String? reason, + String? operationID, }) => _channel.invokeMethod( 'joinGroup', _buildParam({ 'gid': gid, 'reason': reason, + 'operationID': _checkOperationID(operationID), })); /// Leave group /// 退出组 Future quitGroup({ required String gid, + String? operationID, }) => _channel.invokeMethod( 'quitGroup', _buildParam({ 'gid': gid, + 'operationID': _checkOperationID(operationID), })); /// Give group permissions to others @@ -210,44 +260,76 @@ class GroupManager { Future transferGroupOwner({ required String gid, required String uid, + String? operationID, }) => _channel.invokeMethod( 'transferGroupOwner', _buildParam({ 'gid': gid, 'uid': uid, + 'operationID': _checkOperationID(operationID), })); - /// Get the list of applications - /// 获取所有进组申请 - Future getGroupApplicationList() => _channel - .invokeMethod('getGroupApplicationList', _buildParam({})) - .then((value) => GroupApplicationList.fromJson(_formatJson(value))); + /// As the group owner or administrator, get the list of received group members' applications to join the group. + /// 作为群主或者管理员,获取收到的群成员申请进群列表。 + Future> getRecvGroupApplicationList( + {String? operationID}) => + _channel + .invokeMethod( + 'getRecvGroupApplicationList', + _buildParam({ + 'operationID': _checkOperationID(operationID), + })) + .then((value) => (_formatJson(value) as List) + .map((e) => GroupApplicationInfo.fromJson(e)) + .toList()); + + /// Get the record of the group membership application issued by yourself + /// 获取自己发出的入群申请记录 + Future> getSendGroupApplicationList( + {String? operationID}) => + _channel + .invokeMethod( + 'getSendGroupApplicationList', + _buildParam({ + 'operationID': _checkOperationID(operationID), + })) + .then((value) => (_formatJson(value) as List) + .map((e) => GroupApplicationInfo.fromJson(e)) + .toList()); /// Accept group application - /// 同意进组申请 + /// 管理员或者群主同意某人进入某群 Future acceptGroupApplication({ - required GroupApplicationInfo info, - required String reason, + required String gid, + required String uid, + String? handleMsg, + String? operationID, }) => _channel.invokeMethod( 'acceptGroupApplication', _buildParam({ - 'application': info.toJson(), - 'reason': reason, + 'gid': gid, + 'uid': uid, + 'handleMsg': handleMsg, + 'operationID': _checkOperationID(operationID), })); /// Refuse group application - /// 拒绝进组申请 + /// 管理员或者群主拒绝某人进入某群 Future refuseGroupApplication({ - required GroupApplicationInfo info, - required String reason, + required String gid, + required String uid, + String? handleMsg, + String? operationID, }) => _channel.invokeMethod( 'refuseGroupApplication', _buildParam({ - 'application': info.toJson(), - 'reason': reason, + 'gid': gid, + 'uid': uid, + 'handleMsg': handleMsg, + 'operationID': _checkOperationID(operationID), })); /// @@ -280,4 +362,8 @@ class GroupManager { static String _printValue(value) { return value; } + + static String _checkOperationID(String? obj) { + return obj ?? DateTime.now().millisecondsSinceEpoch.toString(); + } } diff --git a/lib/src/manager/im_manager.dart b/lib/src/manager/im_manager.dart index 197da32..280fabd 100644 --- a/lib/src/manager/im_manager.dart +++ b/lib/src/manager/im_manager.dart @@ -3,6 +3,7 @@ import 'dart:developer'; import 'package:flutter/services.dart'; import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; +import 'package:flutter_openim_sdk/src/manager/im_user_manager.dart'; class IMManager { MethodChannel _channel; @@ -10,13 +11,13 @@ class IMManager { late FriendshipManager friendshipManager; late MessageManager messageManager; late GroupManager groupManager; + late UserManager userManager; // late OfflinePushManager offlinePushManager; // late SignalingManager signalingManager; - late InitSDKListener _initSDKListener; + late ConnectListener _connectListener; late String uid; late UserInfo uInfo; - bool isInitialized = false; bool isLogined = false; IMManager(this._channel) { @@ -24,6 +25,7 @@ class IMManager { friendshipManager = FriendshipManager(_channel); messageManager = MessageManager(_channel); groupManager = GroupManager(_channel); + userManager = UserManager(_channel); // offlinePushManager = OfflinePushManager(_channel); // signalingManager = SignalingManager(_channel); _addNativeCallback(_channel); @@ -33,112 +35,88 @@ class IMManager { _channel.setMethodCallHandler((call) { try { log('Flutter : $call'); - if (call.method == ListenerType.initSDKListener) { + if (call.method == ListenerType.connectListener) { String type = call.arguments['type']; - dynamic data = call.arguments['data']; switch (type) { - case 'onSelfInfoUpdated': - uInfo = UserInfo.fromJson(_formatJson(data)); - _initSDKListener.selfInfoUpdated(uInfo); - break; case 'onConnectFailed': int? errCode = call.arguments['errCode']; String? errMsg = call.arguments['errMsg']; - _initSDKListener.connectFailed(errCode, errMsg); + _connectListener.connectFailed(errCode, errMsg); break; case 'onConnecting': - _initSDKListener.connecting(); + _connectListener.connecting(); break; case 'onConnectSuccess': - _initSDKListener.connectSuccess(); + _connectListener.connectSuccess(); break; case 'onKickedOffline': - _initSDKListener.kickedOffline(); + _connectListener.kickedOffline(); break; case 'onUserSigExpired': - _initSDKListener.userSigExpired(); + _connectListener.userSigExpired(); break; } - } else if (call.method == ListenerType.groupListener) { - var args = call.arguments; - String type = args['type']; - Map map = args['data']; + } else if (call.method == ListenerType.userListener) { + String type = call.arguments['type']; + dynamic data = call.arguments['data']; switch (type) { - case 'onMemberEnter': - groupManager.groupListener.memberEnter( - map['groupId'], - (_formatJson(map['memberList']) as List) - .map((e) => GroupMembersInfo.fromJson(e)) - .toList(), - ); + case 'onSelfInfoUpdated': + uInfo = UserInfo.fromJson(_formatJson(data)); + userManager.userListener.selfInfoUpdated(uInfo); break; - case 'onMemberLeave': - groupManager.groupListener.memberLeave( - map['groupId'], - GroupMembersInfo.fromJson(_formatJson(map['member'])), - ); + } + } else if (call.method == ListenerType.groupListener) { + String type = call.arguments['type']; + dynamic data = call.arguments['data']; + switch (type) { + case 'onGroupApplicationAccepted': + final i = GroupApplicationInfo.fromJson(_formatJson(data)); + groupManager.groupListener.groupApplicationAccepted(i); break; - case 'onMemberInvited': - groupManager.groupListener.memberInvited( - map['groupId'], - GroupMembersInfo.fromJson(_formatJson(map['opUser'])), - (_formatJson(map['memberList']) as List) - .map((e) => GroupMembersInfo.fromJson(e)) - .toList(), - ); + case 'onGroupApplicationAdded': + final i = GroupApplicationInfo.fromJson(_formatJson(data)); + groupManager.groupListener.groupApplicationAdded(i); break; - case 'onMemberKicked': - groupManager.groupListener.memberKicked( - map['groupId'], - GroupMembersInfo.fromJson(_formatJson(map['opUser'])), - (_formatJson(map['memberList']) as List) - .map((e) => GroupMembersInfo.fromJson(e)) - .toList(), - ); + case 'onGroupApplicationDeleted': + final i = GroupApplicationInfo.fromJson(_formatJson(data)); + groupManager.groupListener.groupApplicationDeleted(i); break; - case 'onGroupCreated': - groupManager.groupListener.groupCreated( - map['groupId'], - ); + case 'onGroupApplicationRejected': + final i = GroupApplicationInfo.fromJson(_formatJson(data)); + groupManager.groupListener.groupApplicationRejected(i); break; case 'onGroupInfoChanged': - groupManager.groupListener.groupInfoChanged( - map['groupId'], - GroupInfo.fromJson(_formatJson(map['groupInfo'])), - ); + final i = GroupInfo.fromJson(_formatJson(data)); + groupManager.groupListener.groupInfoChanged(i); break; - case 'onReceiveJoinApplication': - groupManager.groupListener.receiveJoinApplication( - map['groupId'], - GroupMembersInfo.fromJson(_formatJson(map['member'])), - map['opReason'], - ); + case 'onGroupMemberAdded': + final i = GroupMembersInfo.fromJson(_formatJson(data)); + groupManager.groupListener.groupMemberAdded(i); break; - case 'onApplicationProcessed': - groupManager.groupListener.applicationProcessed( - map['groupId'], - GroupMembersInfo.fromJson(_formatJson(map['opUser'])), - map['agreeOrReject'], - map['opReason'], - ); + case 'onGroupMemberDeleted': + final i = GroupMembersInfo.fromJson(_formatJson(data)); + groupManager.groupListener.groupMemberDeleted(i); + break; + case 'onGroupMemberInfoChanged': + final i = GroupMembersInfo.fromJson(_formatJson(data)); + groupManager.groupListener.groupMemberInfoChanged(i); + break; + case 'onJoinedGroupAdded': + final i = GroupInfo.fromJson(_formatJson(data)); + groupManager.groupListener.joinedGroupAdded(i); + break; + case 'onJoinedGroupDeleted': + final i = GroupInfo.fromJson(_formatJson(data)); + groupManager.groupListener.joinedGroupDeleted(i); + break; + case 'onReceiveJoinGroupApplicationAdded': + final i = GroupApplicationInfo.fromJson(_formatJson(data)); + groupManager.groupListener.receiveJoinGroupApplicationAdded(i); + break; + case 'onReceiveJoinGroupApplicationDeleted': + final i = GroupApplicationInfo.fromJson(_formatJson(data)); + groupManager.groupListener.receiveJoinGroupApplicationDeleted(i); break; - // case 'onMemberInfoChanged': - // break; - // case 'onGroupDismissed': - // break; - // case 'onGroupRecycled': - // break; - // - // case 'onGrantAdministrator': - // break; - // case 'onRevokeAdministrator': - // break; - // case 'onQuitFromGroup': - // break; - // case 'onReceiveRESTCustomData': - // break; - // case 'onGroupAttributeChanged': - // break; } } else if (call.method == ListenerType.advancedMsgListener) { var type = call.arguments['type']; @@ -147,29 +125,17 @@ class IMManager { case 'onRecvNewMessage': var value = call.arguments['data']['newMessage']; var msg = Message.fromJson(_formatJson(value)); - for (var listener in messageManager.advancedMsgListeners) { - if (listener.id == id) { - listener.recvNewMessage(msg); - } - } + messageManager.advancedMsgListener.recvNewMessage(msg); break; case 'onRecvMessageRevoked': var value = call.arguments['data']['revokedMessage']; - for (var listener in messageManager.advancedMsgListeners) { - if (listener.id == id) { - listener.recvMessageRevoked(value); - } - } + messageManager.advancedMsgListener.recvMessageRevoked(value); break; case 'onRecvC2CReadReceipt': var value = call.arguments['data']['haveReadMessage']; var l = _formatJson(value) as List; var list = l.map((e) => HaveReadInfo.fromJson(e)).toList(); - for (var listener in messageManager.advancedMsgListeners) { - if (listener.id == id) { - listener.recvC2CReadReceipt(list); - } - } + messageManager.advancedMsgListener.recvC2CReadReceipt(list); break; } } else if (call.method == ListenerType.msgSendProgressListener) { @@ -226,38 +192,43 @@ class IMManager { } else if (call.method == ListenerType.friendListener) { String type = call.arguments['type']; dynamic data = call.arguments['data']; - UserInfo u = UserInfo.fromJson(_formatJson(data)); + switch (type) { - case 'onBlackListAdd': - friendshipManager.friendshipListener.blackListAdd(u); + case 'onBlacklistAdded': + final u = BlacklistInfo.fromJson(_formatJson(data)); + friendshipManager.friendshipListener.blacklistAdded(u); break; - case 'onBlackListDeleted': - friendshipManager.friendshipListener.blackListDeleted(u); + case 'onBlacklistDeleted': + final u = BlacklistInfo.fromJson(_formatJson(data)); + friendshipManager.friendshipListener.blacklistDeleted(u); break; - case 'onFriendApplicationListAccept': - friendshipManager.friendshipListener - .friendApplicationListAccept(u); + case 'onFriendApplicationAccepted': + final u = FriendApplicationInfo.fromJson(_formatJson(data)); + friendshipManager.friendshipListener.friendApplicationAccepted(u); break; - case 'onFriendApplicationListAdded': - friendshipManager.friendshipListener - .friendApplicationListAdded(u); + case 'onFriendApplicationAdded': + final u = FriendApplicationInfo.fromJson(_formatJson(data)); + friendshipManager.friendshipListener.friendApplicationAdded(u); break; - case 'onFriendApplicationListDeleted': - friendshipManager.friendshipListener - .friendApplicationListDeleted(u); + case 'onFriendApplicationDeleted': + final u = FriendApplicationInfo.fromJson(_formatJson(data)); + friendshipManager.friendshipListener.friendApplicationDeleted(u); break; - case 'onFriendApplicationListReject': - friendshipManager.friendshipListener - .friendApplicationListReject(u); + case 'onFriendApplicationListRejected': + final u = FriendApplicationInfo.fromJson(_formatJson(data)); + friendshipManager.friendshipListener.friendApplicationRejected(u); break; case 'onFriendInfoChanged': + final u = FriendInfo.fromJson(_formatJson(data)); friendshipManager.friendshipListener.friendInfoChanged(u); break; - case 'onFriendListAdded': - friendshipManager.friendshipListener.friendListAdded(u); + case 'onFriendAdded': + final u = FriendInfo.fromJson(_formatJson(data)); + friendshipManager.friendshipListener.friendAdded(u); break; - case 'onFriendListDeleted': - friendshipManager.friendshipListener.friendListDeleted(u); + case 'onFriendDeleted': + final u = FriendInfo.fromJson(_formatJson(data)); + friendshipManager.friendshipListener.friendDeleted(u); break; } } @@ -272,61 +243,74 @@ class IMManager { /// Initialize SDK /// /// [platform] Refer to [IMPlatform] - /// [ipApi] Api server ip address - /// [ipWs] WebSocket ip address - /// [dbPath] Data storage directory + /// [apiAddr] Api server ip address + /// [wsAddr] WebSocket ip address + /// [dataDir] Data storage directory /// 初始化SDK /// [platform] 平台编号[IMPlatform] - /// [ipApi] SDK api地址 - /// [ipWs] SDK websocket地址 - /// [dbPath] SDK数据库存储目录 + /// [apiAddr] SDK api地址 + /// [wsAddr] SDK websocket地址 + /// [dataDir] SDK数据库存储目录 Future initSDK({ required int platform, - required String ipApi, - required String ipWs, - required String dbPath, - required InitSDKListener listener, + required String apiAddr, + required String wsAddr, + required String dataDir, + required ConnectListener listener, + int logLevel = 6, + String? objectStorage, + String? operationID, }) { - _initSDKListener = listener; - return _channel - .invokeMethod( - 'initSDK', - _buildParam( - { - "platform": platform, - "ipApi": ipApi, - "ipWs": ipWs, - "dbDir": dbPath - }, - )) - .then((value) => isInitialized = true); + _connectListener = listener; + return _channel.invokeMethod( + 'initSDK', + _buildParam( + { + "platform": platform, + "api_addr": apiAddr, + "ws_addr": wsAddr, + "data_dir": dataDir, + "log_level": logLevel, + "object_storage": objectStorage, + "operationID": _checkOperationID(operationID), + }, + )); } @deprecated Future unInitSDK() { - return _channel.invokeMethod('unInitSDK', _buildParam({})).then((value) { - isInitialized = false; - return value; - }); + return _channel.invokeMethod('unInitSDK', _buildParam({})); } /// Login sdk /// 登录 - Future login({required String uid, required String token}) async { - this.uid = uid; + Future login({ + required String uid, + required String token, + String? operationID, + }) async { await _channel.invokeMethod( 'login', - _buildParam({'uid': uid, 'token': token}), + _buildParam({ + 'uid': uid, + 'token': token, + 'operationID': _checkOperationID(operationID), + }), ); this.isLogined = true; - this.uInfo = (await getUsersInfo([uid])).first; + this.uid = uid; + this.uInfo = await userManager.getSelfUserInfo(); return uInfo; } /// Logout sdk /// 登出 - Future logout() async { - var value = await _channel.invokeMethod('logout', _buildParam({})); + Future logout({String? operationID}) async { + var value = await _channel.invokeMethod( + 'logout', + _buildParam({ + 'operationID': _checkOperationID(operationID), + })); this.isLogined = false; return value; } @@ -337,65 +321,24 @@ class IMManager { /// Current user id /// 获取当前登录用户id - Future getLoginUid() async => uid; + Future getLoginUserID() async => uid; /// Current user info /// 获取当前登录用户信息 Future getLoginUserInfo() async => uInfo; - /// Modify current user info - /// 修改当前登录用户资料 - Future setSelfInfo( - {String? name, - String? icon, - int? gender, - String? mobile, - String? birth, - String? email, - String? ex}) => - _channel.invokeMethod( - 'setSelfInfo', - _buildParam({ - 'uid': uid, - 'name': name, - 'icon': icon, - 'gender': gender, - 'mobile': mobile, - 'birth': birth, - 'email': email, - 'ex': ex, - })); - - /// Query user information - /// 查询用户信息 - Future> getUsersInfo(List uidList) => _channel - .invokeMethod('getUsersInfo', _buildParam({'uidList': uidList})) - .then((value) => _toList(value)); - - /// - Future enabledSDKLog({required bool enabled}) => _channel.invokeMethod( - 'setSdkLog', _buildParam({'sdkLog': enabled ? 0 : 1})); - - /// - Future forceSyncLoginUerInfo(List uidList) => - _channel.invokeMethod('forceSyncLoginUerInfo', _buildParam({})); - - /// - // Future forceReConn() { - // return _channel.invokeMethod('forceReConn', _buildParam({})); - // } - static Map _buildParam(Map param) { param["ManagerName"] = "imManager"; return param; } - static List _toList(String value) => - (_formatJson(value) as List).map((e) => UserInfo.fromJson(e)).toList(); - static dynamic _formatJson(value) => jsonDecode(_printValue(value)); static String _printValue(value) { return value; } + + static String _checkOperationID(String? obj) { + return obj ?? DateTime.now().millisecondsSinceEpoch.toString(); + } } diff --git a/lib/src/manager/im_message_manager.dart b/lib/src/manager/im_message_manager.dart index 626ac9a..2c2fffd 100644 --- a/lib/src/manager/im_message_manager.dart +++ b/lib/src/manager/im_message_manager.dart @@ -5,28 +5,20 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; class MessageManager { MethodChannel _channel; - List advancedMsgListeners = List.empty(growable: true); + + // List advancedMsgListeners = List.empty(growable: true); MsgSendProgressListener? msgSendProgressListener; + late AdvancedMsgListener advancedMsgListener; MessageManager(this._channel); - /// Add a message listener + /// Set a message listener /// 消息监听 - Future addAdvancedMsgListener(AdvancedMsgListener listener) { - advancedMsgListeners.add(listener); - return _channel.invokeMethod( - 'addAdvancedMsgListener', - _buildParam({ - 'id': listener.id, - })); - } - - /// Remove a message listener - @deprecated - Future removeAdvancedMsgListener(AdvancedMsgListener listener) { - advancedMsgListeners.remove(listener); + Future setAdvancedMsgListener(AdvancedMsgListener listener) { + this.advancedMsgListener = listener; + // advancedMsgListeners.add(listener); return _channel.invokeMethod( - 'removeAdvancedMsgListener', + 'setAdvancedMsgListener', _buildParam({ 'id': listener.id, })); @@ -47,7 +39,8 @@ class MessageManager { required Message message, String? userID, String? groupID, - bool onlineUserOnly = false, + OfflinePushInfo? offlinePushInfo, + String? operationID, }) => _channel.invokeMethod( 'sendMessage', @@ -55,7 +48,8 @@ class MessageManager { 'message': message.toJson(), 'userID': userID ?? '', 'groupID': groupID ?? '', - 'onlineUserOnly': onlineUserOnly, + 'offlinePushInfo': offlinePushInfo?.toJson(), + 'operationID': _checkOperationID(operationID), })) /*.then((value) => _toObj(value))*/; /// Find all history message @@ -67,40 +61,57 @@ class MessageManager { String? groupID, Message? startMsg, int? count, + String? operationID, }) => _channel .invokeMethod( 'getHistoryMessageList', _buildParam({ 'userID': userID ?? '', - 'startMsg': startMsg?.toJson() /*?? {}*/, 'groupID': groupID ?? '', + 'startClientMsgID': startMsg?.clientMsgID ?? '', 'count': count ?? 10, + 'operationID': _checkOperationID(operationID), })) .then((value) => _toList(value)); /// Revoke the sent information /// 撤回消息 - Future revokeMessage({required Message message}) => - _channel.invokeMethod('revokeMessage', _buildParam(message.toJson())); + Future revokeMessage({ + required Message message, + String? operationID, + }) => + _channel.invokeMethod( + 'revokeMessage', + _buildParam(message.toJson() + ..addAll({ + "operationID": _checkOperationID(operationID), + }))); /// Delete message /// 删除消息 - Future deleteMessageFromLocalStorage({required Message message}) => + Future deleteMessageFromLocalStorage({ + required Message message, + String? operationID, + }) => _channel.invokeMethod( - 'deleteMessageFromLocalStorage', _buildParam(message.toJson())); + 'deleteMessageFromLocalStorage', + _buildParam(message.toJson() + ..addAll({ + "operationID": _checkOperationID(operationID), + }))); /// - @deprecated - Future deleteMessages({required List msgList}) => - _channel.invokeMethod('deleteMessages', - _buildParam({"msgList": msgList.map((e) => e.toJson()).toList()})); + // Future deleteMessages({required List msgList}) => + // _channel.invokeMethod('deleteMessages', + // _buildParam({"msgList": msgList.map((e) => e.toJson()).toList()})); /// Future insertSingleMessageToLocalStorage({ String? receiverID, String? senderID, Message? message, + String? operationID, }) => _channel.invokeMethod( 'insertSingleMessageToLocalStorage', @@ -108,53 +119,68 @@ class MessageManager { "message": message?.toJson(), "receiverID": receiverID, "senderID": senderID, + "operationID": _checkOperationID(operationID), })); /// Query the message according to the message id - Future findMessages({required List messageIDList}) => - _channel.invokeMethod( - 'findMessages', - _buildParam({ - "messageIDList": messageIDList, - })); + // Future findMessages({required List messageIDList}) => + // _channel.invokeMethod( + // 'findMessages', + // _buildParam({ + // "messageIDList": messageIDList, + // })); /// Mark c2c message as read /// 标记c2c消息已读 Future markC2CMessageAsRead({ required String userID, required List messageIDList, + String? operationID, }) => _channel.invokeMethod( 'markC2CMessageAsRead', _buildParam({ "messageIDList": messageIDList, "userID": userID, + "operationID": _checkOperationID(operationID), })); /// Typing /// 正在输入提示 Future typingStatusUpdate({ required String userID, - bool typing = false, + String? msgTip, + String? operationID, }) => _channel.invokeMethod( 'typingStatusUpdate', _buildParam({ - "typing": typing ? 'yes' : 'no', + "msgTip": msgTip, "userID": userID, + "operationID": _checkOperationID(operationID), })); /// Create text message /// 创建文本消息 - Future createTextMessage({required String text}) => _channel - .invokeMethod('createTextMessage', _buildParam({'text': text})) - .then((value) => _toObj(value)); + Future createTextMessage({ + required String text, + String? operationID, + }) => + _channel + .invokeMethod( + 'createTextMessage', + _buildParam({ + 'text': text, + "operationID": _checkOperationID(operationID), + })) + .then((value) => _toObj(value)); /// Create @ message /// 创建@消息 Future createTextAtMessage({ required String text, required List atUidList, + String? operationID, }) => _channel .invokeMethod( @@ -162,26 +188,40 @@ class MessageManager { _buildParam({ 'text': text, 'atUserList': atUidList, + "operationID": _checkOperationID(operationID), }), ) .then((value) => _toObj(value)); /// Create picture message /// 创建图片消息 - Future createImageMessage({required String imagePath}) => _channel - .invokeMethod( - 'createImageMessage', - _buildParam({'imagePath': imagePath}), - ) - .then((value) => _toObj(value)); + Future createImageMessage({ + required String imagePath, + String? operationID, + }) => + _channel + .invokeMethod( + 'createImageMessage', + _buildParam({ + 'imagePath': imagePath, + "operationID": _checkOperationID(operationID), + }), + ) + .then((value) => _toObj(value)); /// Create picture message /// 创建图片消息 - Future createImageMessageFromFullPath({required String imagePath}) => + Future createImageMessageFromFullPath({ + required String imagePath, + String? operationID, + }) => _channel .invokeMethod( 'createImageMessageFromFullPath', - _buildParam({'imagePath': imagePath}), + _buildParam({ + 'imagePath': imagePath, + "operationID": _checkOperationID(operationID), + }), ) .then((value) => _toObj(value)); @@ -190,11 +230,16 @@ class MessageManager { Future createSoundMessage({ required String soundPath, required int duration, + String? operationID, }) => _channel .invokeMethod( 'createSoundMessage', - _buildParam({'soundPath': soundPath, "duration": duration}), + _buildParam({ + 'soundPath': soundPath, + "duration": duration, + "operationID": _checkOperationID(operationID), + }), ) .then((value) => _toObj(value)); @@ -203,11 +248,16 @@ class MessageManager { Future createSoundMessageFromFullPath({ required String soundPath, required int duration, + String? operationID, }) => _channel .invokeMethod( 'createSoundMessageFromFullPath', - _buildParam({'soundPath': soundPath, "duration": duration}), + _buildParam({ + 'soundPath': soundPath, + "duration": duration, + "operationID": _checkOperationID(operationID), + }), ) .then((value) => _toObj(value)); @@ -218,6 +268,7 @@ class MessageManager { required String videoType, required int duration, required String snapshotPath, + String? operationID, }) => _channel .invokeMethod( @@ -227,6 +278,7 @@ class MessageManager { 'videoType': videoType, 'duration': duration, 'snapshotPath': snapshotPath, + "operationID": _checkOperationID(operationID), })) .then((value) => _toObj(value)); @@ -237,6 +289,7 @@ class MessageManager { required String videoType, required int duration, required String snapshotPath, + String? operationID, }) => _channel .invokeMethod( @@ -246,6 +299,7 @@ class MessageManager { 'videoType': videoType, 'duration': duration, 'snapshotPath': snapshotPath, + "operationID": _checkOperationID(operationID), })) .then((value) => _toObj(value)); @@ -254,6 +308,7 @@ class MessageManager { Future createFileMessage({ required String filePath, required String fileName, + String? operationID, }) { return _channel .invokeMethod( @@ -261,6 +316,7 @@ class MessageManager { _buildParam({ 'filePath': filePath, 'fileName': fileName, + "operationID": _checkOperationID(operationID), })) .then((value) => _toObj(value)); } @@ -270,6 +326,7 @@ class MessageManager { Future createFileMessageFromFullPath({ required String filePath, required String fileName, + String? operationID, }) => _channel .invokeMethod( @@ -277,6 +334,7 @@ class MessageManager { _buildParam({ 'filePath': filePath, 'fileName': fileName, + "operationID": _checkOperationID(operationID), })) .then((value) => _toObj(value)); @@ -286,6 +344,7 @@ class MessageManager { required List messageList, required String title, required List summaryList, + String? operationID, }) => _channel .invokeMethod( @@ -294,17 +353,22 @@ class MessageManager { 'messageList': messageList.map((e) => e.toJson()).toList(), 'title': title, 'summaryList': summaryList, + "operationID": _checkOperationID(operationID), })) .then((value) => _toObj(value)); /// Create forward message /// 创建转发消息 - Future createForwardMessage({required Message message}) { + Future createForwardMessage({ + required Message message, + String? operationID, + }) { return _channel .invokeMethod( 'createForwardMessage', _buildParam({ 'message': message.toJson(), + "operationID": _checkOperationID(operationID), })) .then((value) => _toObj(value)); } @@ -315,6 +379,7 @@ class MessageManager { required double latitude, required double longitude, required String description, + String? operationID, }) => _channel .invokeMethod( @@ -323,6 +388,7 @@ class MessageManager { 'latitude': latitude, 'longitude': longitude, 'description': description, + "operationID": _checkOperationID(operationID), })) .then((value) => _toObj(value)); @@ -332,6 +398,7 @@ class MessageManager { required String data, required String extension, required String description, + String? operationID, }) => _channel .invokeMethod( @@ -340,6 +407,7 @@ class MessageManager { 'data': data, 'extension': extension, 'description': description, + "operationID": _checkOperationID(operationID), })) .then((value) => _toObj(value)); @@ -348,6 +416,7 @@ class MessageManager { Future createQuoteMessage({ required String text, required Message quoteMsg, + String? operationID, }) => _channel .invokeMethod( @@ -355,6 +424,7 @@ class MessageManager { _buildParam({ 'quoteText': text, 'quoteMessage': quoteMsg.toJson(), + "operationID": _checkOperationID(operationID), })) .then((value) => _toObj(value)); @@ -362,24 +432,42 @@ class MessageManager { /// 创建卡片消息 Future createCardMessage({ required Map data, + String? operationID, }) => _channel .invokeMethod( 'createCardMessage', _buildParam({ 'cardMessage': data, + "operationID": _checkOperationID(operationID), })) .then((value) => _toObj(value)); /// Clear all c2c history message /// 清空单聊消息记录 - Future clearC2CHistoryMessage({required String uid}) => _channel - .invokeMethod('clearC2CHistoryMessage', _buildParam({"userID": uid})); + Future clearC2CHistoryMessage({ + required String uid, + String? operationID, + }) => + _channel.invokeMethod( + 'clearC2CHistoryMessage', + _buildParam({ + "userID": uid, + "operationID": _checkOperationID(operationID), + })); /// Clear all group history /// 清空组消息记录 - Future clearGroupHistoryMessage({required String gid}) => _channel - .invokeMethod('clearGroupHistoryMessage', _buildParam({"groupID": gid})); + Future clearGroupHistoryMessage({ + required String gid, + String? operationID, + }) => + _channel.invokeMethod( + 'clearGroupHistoryMessage', + _buildParam({ + "groupID": gid, + "operationID": _checkOperationID(operationID), + })); /// // void forceSyncMsg() { @@ -401,4 +489,8 @@ class MessageManager { static String _printValue(value) { return value; } + + static String _checkOperationID(String? obj) { + return obj ?? DateTime.now().millisecondsSinceEpoch.toString(); + } } diff --git a/lib/src/manager/im_user_manager.dart b/lib/src/manager/im_user_manager.dart new file mode 100644 index 0000000..0b51082 --- /dev/null +++ b/lib/src/manager/im_user_manager.dart @@ -0,0 +1,95 @@ +import 'dart:convert'; + +import 'package:flutter/services.dart'; +import 'package:flutter_openim_sdk/flutter_openim_sdk.dart'; + +class UserManager { + MethodChannel _channel; + late UserListener userListener; + + UserManager(this._channel); + + /// Observe user info changes + /// 用户资料改变监听 + Future setUserListener(UserListener listener) { + this.userListener = listener; + return _channel.invokeMethod('setUserListener', _buildParam({})); + } + + /// Query user information + /// 获取用户资料 + Future> getUsersInfo({ + required List uidList, + String? operationID, + }) => + _channel + .invokeMethod( + 'getUsersInfo', + _buildParam({ + 'uidList': uidList, + 'operationID': _checkOperationID(operationID), + })) + .then((value) => _toList(value, (v) => UserInfo.fromJson(v.cast()))); + + /// Get the information of the currently logged in user + /// 获取当前登录用户的信息 + Future getSelfUserInfo({ + String? operationID, + }) => + _channel + .invokeMethod( + 'getSelfUserInfo', + _buildParam({ + 'operationID': _checkOperationID(operationID), + })) + .then((value) => UserInfo.fromJson(_formatJson(value))); + + /// Modify current user info + /// 修改当前登录用户资料 + Future setSelfInfo({ + String? nickname, + String? faceURL, + int? gender, + int? appMangerLevel, + String? phoneNumber, + String? birth, + String? email, + String? ex, + String? operationID, + }) => + _channel.invokeMethod( + 'setSelfInfo', + _buildParam({ + // 'userID': userID, + 'nickname': nickname, + 'faceURL': faceURL, + 'gender': gender, + 'appMangerLevel': appMangerLevel, + 'phoneNumber': phoneNumber, + 'birth': birth, + 'email': email, + 'ex': ex, + 'operationID': _checkOperationID(operationID), + })); + + static Map _buildParam(Map param) { + param["ManagerName"] = "userManager"; + return param; + } + + static List _toList(String? value, T f(Map map)) { + var list = _formatJson(value); + if (null == list) return []; + return (list as List).map((e) => f(e)).toList(); + } + + static dynamic _formatJson(value) => jsonDecode(_printValue(value)); + + static String _printValue(value) { + return value; + } + + static String _checkOperationID(String? obj) { + return obj ?? DateTime.now().millisecondsSinceEpoch.toString(); + } +} diff --git a/lib/src/models/conversation_info.dart b/lib/src/models/conversation_info.dart index 0a08373..d63a68f 100644 --- a/lib/src/models/conversation_info.dart +++ b/lib/src/models/conversation_info.dart @@ -10,16 +10,16 @@ class ConversationInfo { String? userID; String? groupID; String? showName; - String? faceUrl; + String? faceURL; int? recvMsgOpt; int? unreadCount; + int? groupAtType; Message? latestMsg; int? latestMsgSendTime; String? draftText; - int? draftTimestamp; - - /// pinned value is 1 - dynamic isPinned; + int? draftTextTime; + bool? isPinned; + String? ext; ConversationInfo( {required this.conversationID, @@ -27,13 +27,13 @@ class ConversationInfo { this.userID, this.groupID, this.showName, - this.faceUrl, + this.faceURL, this.recvMsgOpt, this.unreadCount, this.latestMsg, this.latestMsgSendTime, this.draftText, - this.draftTimestamp, + this.draftTextTime, this.isPinned}); ConversationInfo.fromJson(Map json) @@ -43,7 +43,7 @@ class ConversationInfo { userID = json['userID']; groupID = json['groupID']; showName = json['showName']; - faceUrl = json['faceUrl']; + faceURL = json['faceURL']; recvMsgOpt = json['recvMsgOpt']; unreadCount = json['unreadCount']; // latestMsg = json['latestMsg']; @@ -60,7 +60,7 @@ class ConversationInfo { latestMsgSendTime = json['latestMsgSendTime']; draftText = json['draftText']; - draftTimestamp = json['draftTimestamp']; + draftTextTime = json['draftTextTime']; isPinned = json['isPinned']; } @@ -71,13 +71,13 @@ class ConversationInfo { data['userID'] = this.userID; data['groupID'] = this.groupID; data['showName'] = this.showName; - data['faceUrl'] = this.faceUrl; + data['faceURL'] = this.faceURL; data['recvMsgOpt'] = this.recvMsgOpt; data['unreadCount'] = this.unreadCount; data['latestMsg'] = this.latestMsg?.toJson(); data['latestMsgSendTime'] = this.latestMsgSendTime; data['draftText'] = this.draftText; - data['draftTimestamp'] = this.draftTimestamp; + data['draftTextTime'] = this.draftTextTime; data['isPinned'] = this.isPinned; return data; } @@ -86,7 +86,6 @@ class ConversationInfo { bool get isGroupChat => conversationType == ConversationType.group_chat; - bool get isTop => isPinned == 1; @override bool operator ==(Object other) => diff --git a/lib/src/models/group_info.dart b/lib/src/models/group_info.dart index f790361..5fc3302 100644 --- a/lib/src/models/group_info.dart +++ b/lib/src/models/group_info.dart @@ -3,30 +3,43 @@ class GroupInfo { String? groupName; String? notification; String? introduction; - String? faceUrl; - String? ownerId; + String? faceURL; + String? ownerUserID; int? createTime; int? memberCount; + int? status; + String? creatorUserID; + int? groupType; + String? ex; - GroupInfo( - {required this.groupID, - this.groupName, - this.notification, - this.introduction, - this.faceUrl, - this.ownerId, - this.createTime, - this.memberCount}); + GroupInfo({ + required this.groupID, + this.groupName, + this.notification, + this.introduction, + this.faceURL, + this.ownerUserID, + this.createTime, + this.memberCount, + this.status, + this.creatorUserID, + this.groupType, + this.ex, + }); GroupInfo.fromJson(Map json) : groupID = json['groupID'] { /*groupID = json['groupID'];*/ groupName = json['groupName']; notification = json['notification']; introduction = json['introduction']; - faceUrl = json['faceUrl']; - ownerId = json['ownerId']; + faceURL = json['faceURL']; + ownerUserID = json['ownerUserID']; createTime = json['createTime']; memberCount = json['memberCount']; + status = json['status']; + creatorUserID = json['creatorUserID']; + groupType = json['groupType']; + ex = json['ex']; } Map toJson() { @@ -35,217 +48,257 @@ class GroupInfo { data['groupName'] = this.groupName; data['notification'] = this.notification; data['introduction'] = this.introduction; - data['faceUrl'] = this.faceUrl; - data['ownerId'] = this.ownerId; + data['faceURL'] = this.faceURL; + data['ownerUserID'] = this.ownerUserID; data['createTime'] = this.createTime; data['memberCount'] = this.memberCount; - return data; - } -} - -class GroupMembersList { - int? nextSeq; - List? data; - - GroupMembersList({this.nextSeq, this.data}); - - GroupMembersList.fromJson(Map json) { - nextSeq = json['nextSeq']; - if (json['data'] is List) { - data = (json['data'] as List) - .map((e) => GroupMembersInfo.fromJson(e)) - .toList(); - } - } - - Map toJson() { - final Map data = new Map(); - data['nextSeq'] = this.nextSeq; - if (this.data != null) { - data['data'] = this.data!.map((v) => v.toJson()).toList(); - } + data['status'] = this.status; + data['creatorUserID'] = this.creatorUserID; + data['groupType'] = this.groupType; + data['ex'] = this.ex; return data; } } class GroupMembersInfo { String? groupID; - String? userId; - int? role; + String? userID; + String? nickname; + String? faceURL; + int? roleLevel; int? joinTime; - String? nickName; - String? faceUrl; - dynamic ext; + int? joinSource; + String? operatorUserID; + String? ext; GroupMembersInfo({ this.groupID, - this.userId, - this.role, + this.userID, + this.roleLevel, this.joinTime, - this.nickName, - this.faceUrl, + this.nickname, + this.faceURL, this.ext, + this.joinSource, + this.operatorUserID, }); GroupMembersInfo.fromJson(Map json) { groupID = json['groupID']; - userId = json['userId']; - role = json['role']; + userID = json['userID']; + roleLevel = json['roleLevel']; joinTime = json['joinTime']; - nickName = json['nickName']; - faceUrl = json['faceUrl']; + nickname = json['nickname']; + faceURL = json['faceURL']; ext = json['ext']; + joinSource = json['joinSource']; + operatorUserID = json['operatorUserID']; } Map toJson() { final Map data = new Map(); data['groupID'] = this.groupID; - data['userId'] = this.userId; - data['role'] = this.role; + data['userID'] = this.userID; + data['roleLevel'] = this.roleLevel; data['joinTime'] = this.joinTime; - data['nickName'] = this.nickName; - data['faceUrl'] = this.faceUrl; + data['nickname'] = this.nickname; + data['faceURL'] = this.faceURL; data['ext'] = this.ext; - return data; - } -} - -class GroupInviteResult { - String? uid; - int? result; - - GroupInviteResult({this.uid, this.result}); - - GroupInviteResult.fromJson(Map json) { - uid = json['uid']; - result = json['result']; - } - - Map toJson() { - final Map data = new Map(); - data['uid'] = this.uid; - data['result'] = this.result; + data['joinSource'] = this.joinSource; + data['operatorUserID'] = this.operatorUserID; return data; } } class GroupMemberRole { - String? uid; - int? setRole; + String? userID; + + /// 1 ordinary member, 2 group owners, 3 administrators + /// 1普通成员, 2群主,3管理员 + int? roleLevel; - GroupMemberRole({this.uid, this.setRole}); + GroupMemberRole({this.userID, this.roleLevel = 1}); GroupMemberRole.fromJson(Map json) { - uid = json['uid']; - setRole = json['setRole']; + userID = json['userID']; + roleLevel = json['roleLevel']; } Map toJson() { final Map data = new Map(); - data['uid'] = this.uid; - data['setRole'] = this.setRole; + data['userID'] = this.userID; + data['roleLevel'] = this.roleLevel; return data; } } class GroupApplicationInfo { - String? id; String? groupID; - String? fromUserID; - String? toUserID; - int? flag; //INIT = 0, REFUSE = -1, AGREE = 1 + String? groupName; + String? notification; + String? introduction; + String? groupFaceURL; + int? createTime; + int? status; + String? creatorUserID; + int? groupType; + String? ownerUserID; + int? memberCount; + String? userID; + String? nickname; + String? userFaceURL; + int? gender; + int? handleResult; //REFUSE = -1, AGREE = 1 String? reqMsg; String? handledMsg; - int? createTime; - String? fromUserNickName; - String? toUserNickName; - String? fromUserFaceURL; - String? toUserFaceURL; - String? handledUser; - int? type; //APPLICATION = 0, INVITE = 1 - int? handleStatus; //UNHANDLED = 0, BY_OTHER = 1, BY_SELF = 2 - int? handleResult; //REFUSE = 0, AGREE = 1 - - GroupApplicationInfo( - {this.id, - this.groupID, - this.fromUserID, - this.toUserID, - this.flag, - this.reqMsg, - this.handledMsg, - this.createTime, - this.fromUserNickName, - this.toUserNickName, - this.fromUserFaceURL, - this.toUserFaceURL, - this.handledUser, - this.type, - this.handleStatus, - this.handleResult}); + int? reqTime; + String? handleUserID; + int? handledTime; + String? ex; + + GroupApplicationInfo({ + this.groupID, + this.groupName, + this.notification, + this.introduction, + this.groupFaceURL, + this.createTime, + this.status, + this.creatorUserID, + this.groupType, + this.ownerUserID, + this.memberCount, + this.userID, + this.nickname, + this.userFaceURL, + this.gender, + this.handleResult, + this.reqMsg, + this.handledMsg, + this.reqTime, + this.handleUserID, + this.handledTime, + this.ex, + }); GroupApplicationInfo.fromJson(Map json) { - id = json['id']; groupID = json['groupID']; - fromUserID = json['fromUserID']; - toUserID = json['toUserID']; - flag = json['flag']; - reqMsg = json['reqMsg']; - handledMsg = json['handledMsg']; + groupName = json['groupName']; + notification = json['notification']; + introduction = json['introduction']; + groupFaceURL = json['groupFaceURL']; createTime = json['createTime']; - fromUserNickName = json['fromUserNickName']; - toUserNickName = json['toUserNickName']; - fromUserFaceURL = json['fromUserFaceURL']; - toUserFaceURL = json['toUserFaceURL']; - handledUser = json['handledUser']; - type = json['type']; - handleStatus = json['handleStatus']; + status = json['status']; + creatorUserID = json['creatorUserID']; + groupType = json['groupType']; + ownerUserID = json['ownerUserID']; + memberCount = json['memberCount']; + userID = json['userID']; + nickname = json['nickname']; + userFaceURL = json['userFaceURL']; + gender = json['gender']; handleResult = json['handleResult']; + reqMsg = json['reqMsg']; + handledMsg = json['handledMsg']; + reqTime = json['reqTime']; + handleUserID = json['handleUserID']; + handledTime = json['handledTime']; + ex = json['ex']; } Map toJson() { - final Map data = new Map(); - data['id'] = this.id; + final data = Map(); data['groupID'] = this.groupID; - data['fromUserID'] = this.fromUserID; - data['toUserID'] = this.toUserID; - data['flag'] = this.flag; - data['reqMsg'] = this.reqMsg; - data['handledMsg'] = this.handledMsg; + data['groupName'] = this.groupName; + data['notification'] = this.notification; + data['introduction'] = this.introduction; + data['groupFaceURL'] = this.groupFaceURL; data['createTime'] = this.createTime; - data['fromUserNickName'] = this.fromUserNickName; - data['toUserNickName'] = this.toUserNickName; - data['fromUserFaceURL'] = this.fromUserFaceURL; - data['toUserFaceURL'] = this.toUserFaceURL; - data['handledUser'] = this.handledUser; - data['type'] = this.type; - data['handleStatus'] = this.handleStatus; + data['status'] = this.status; + data['creatorUserID'] = this.creatorUserID; + data['groupType'] = this.groupType; + data['ownerUserID'] = this.ownerUserID; + data['memberCount'] = this.memberCount; + data['userID'] = this.userID; + data['nickname'] = this.nickname; + data['userFaceURL'] = this.userFaceURL; + data['gender'] = this.gender; data['handleResult'] = this.handleResult; + data['reqMsg'] = this.reqMsg; + data['handledMsg'] = this.handledMsg; + data['reqTime'] = this.reqTime; + data['handleUserID'] = this.handleUserID; + data['handledTime'] = this.handledTime; + data['ex'] = this.ex; return data; } } -class GroupApplicationList { - int? count; - List? user; +class GroupInviteResult { + String? userID; + int? result; - GroupApplicationList({this.count, this.user}); + GroupInviteResult({this.userID, this.result}); - GroupApplicationList.fromJson(Map json) { - count = json['count']; - if (json['user'] is List) { - user = (json['user'] as List) - .map((e) => GroupApplicationInfo.fromJson(e)) - .toList(); - } + GroupInviteResult.fromJson(Map json) { + userID = json['userID']; + result = json['result']; } Map toJson() { final Map data = new Map(); - data['count'] = this.count; - if (this.user != null) { - data['user'] = this.user!.map((v) => v.toJson()).toList(); - } + data['userID'] = this.userID; + data['result'] = this.result; return data; } } + +// class GroupMembersList { +// int? nextSeq; +// List? data; +// +// GroupMembersList({this.nextSeq, this.data}); +// +// GroupMembersList.fromJson(Map json) { +// nextSeq = json['nextSeq']; +// if (json['data'] is List) { +// data = (json['data'] as List) +// .map((e) => GroupMembersInfo.fromJson(e)) +// .toList(); +// } +// } +// +// Map toJson() { +// final Map data = new Map(); +// data['nextSeq'] = this.nextSeq; +// if (this.data != null) { +// data['data'] = this.data!.map((v) => v.toJson()).toList(); +// } +// return data; +// } +// } +// +// class GroupApplicationList { +// int? count; +// List? user; +// +// GroupApplicationList({this.count, this.user}); +// +// GroupApplicationList.fromJson(Map json) { +// count = json['count']; +// if (json['user'] is List) { +// user = (json['user'] as List) +// .map((e) => GroupApplicationInfo.fromJson(e)) +// .toList(); +// } +// } +// +// Map toJson() { +// final Map data = new Map(); +// data['count'] = this.count; +// if (this.user != null) { +// data['user'] = this.user!.map((v) => v.toJson()).toList(); +// } +// return data; +// } +// } diff --git a/lib/src/models/message.dart b/lib/src/models/message.dart index 4001e2a..81c3678 100644 --- a/lib/src/models/message.dart +++ b/lib/src/models/message.dart @@ -3,6 +3,9 @@ class Message { String? serverMsgID; int? createTime; int? sendTime; + + /// [ConversationType] + int? sessionType; String? sendID; String? recvID; int? msgFrom; @@ -10,8 +13,7 @@ class Message { /// [MessageType] int? contentType; int? platformID; - List? forceList; - String? senderNickName; + String? senderNickname; String? senderFaceUrl; String? groupID; String? content; @@ -20,11 +22,10 @@ class Message { /// [MessageStatus] int? status; - String? remark; + OfflinePushInfo? offlinePush; + String? attachedInfo; + String? ex; dynamic ext; - - /// [ConversationType] - int? sessionType; PictureElem? pictureElem; SoundElem? soundElem; VideoElem? videoElem; @@ -34,28 +35,30 @@ class Message { CustomElem? customElem; QuoteElem? quoteElem; MergeElem? mergeElem; + NotificationElem? notificationElem; Message({ this.clientMsgID, this.serverMsgID, this.createTime, this.sendTime, + this.sessionType, this.sendID, this.recvID, this.msgFrom, this.contentType, this.platformID, - this.forceList, - this.senderNickName, + this.senderNickname, this.senderFaceUrl, this.groupID, this.content, this.seq, this.isRead, this.status, - this.remark, + this.offlinePush, + this.attachedInfo, + this.ex, this.ext, - this.sessionType, this.pictureElem, this.soundElem, this.videoElem, @@ -65,6 +68,7 @@ class Message { this.customElem, this.quoteElem, this.mergeElem, + this.notificationElem, }); Message.fromJson( @@ -78,17 +82,18 @@ class Message { msgFrom = json['msgFrom']; contentType = json['contentType']; platformID = json['platformID']; - if (json['forceList'] is List) { - forceList = (json['forceList'] as List).map((e) => '$e').toList(); - } - senderNickName = json['senderNickName']; + senderNickname = json['senderNickname']; senderFaceUrl = json['senderFaceUrl']; groupID = json['groupID']; content = json['content']; seq = json['seq']; isRead = json['isRead']; status = json['status']; - remark = json['remark']; + offlinePush = json['offlinePush'] != null + ? OfflinePushInfo.fromJson(json['offlinePush']) + : null; + attachedInfo = json['attachedInfo']; + ex = json['ex']; ext = json['ext']; sessionType = json['sessionType']; pictureElem = json['pictureElem'] != null @@ -116,6 +121,9 @@ class Message { mergeElem = json['mergeElem'] != null ? MergeElem.fromJson(json['mergeElem']) : null; + notificationElem = json['notificationElem'] != null + ? NotificationElem.fromJson(json['notificationElem']) + : null; } Map toJson() { @@ -129,15 +137,16 @@ class Message { data['msgFrom'] = this.msgFrom; data['contentType'] = this.contentType; data['platformID'] = this.platformID; - data['forceList'] = this.forceList; - data['senderNickName'] = this.senderNickName; + data['senderNickname'] = this.senderNickname; data['senderFaceUrl'] = this.senderFaceUrl; data['groupID'] = this.groupID; data['content'] = this.content; data['seq'] = this.seq; data['isRead'] = this.isRead; data['status'] = this.status; - data['remark'] = this.remark; + data['offlinePush'] = this.offlinePush?.toJson(); + data['attachedInfo'] = this.attachedInfo; + data['ex'] = this.ex; data['ext'] = this.ext; data['sessionType'] = this.sessionType; data['pictureElem'] = this.pictureElem?.toJson(); @@ -149,6 +158,7 @@ class Message { data['customElem'] = this.customElem?.toJson(); data['quoteElem'] = this.quoteElem?.toJson(); data['mergeElem'] = this.mergeElem?.toJson(); + data['notificationElem'] = this.notificationElem?.toJson(); return data; } @@ -205,7 +215,7 @@ class PictureElem { } class PictureInfo { - String? uuID; + String? uuid; String? type; int? size; int? width; @@ -213,10 +223,10 @@ class PictureInfo { String? url; PictureInfo( - {this.uuID, this.type, this.size, this.width, this.height, this.url}); + {this.uuid, this.type, this.size, this.width, this.height, this.url}); PictureInfo.fromJson(Map json) { - uuID = json['uuID']; + uuid = json['uuid']; type = json['type']; size = json['size']; width = json['width']; @@ -226,7 +236,7 @@ class PictureInfo { Map toJson() { final Map data = new Map(); - data['uuID'] = this.uuID; + data['uuid'] = this.uuid; data['type'] = this.type; data['size'] = this.size; data['width'] = this.width; @@ -237,21 +247,21 @@ class PictureInfo { } class SoundElem { - String? uuID; + String? uuid; String? soundPath; String? sourceUrl; int? dataSize; int? duration; SoundElem( - {this.uuID, + {this.uuid, this.soundPath, this.sourceUrl, this.dataSize, this.duration}); SoundElem.fromJson(Map json) { - uuID = json['uuID']; + uuid = json['uuid']; soundPath = json['soundPath']; sourceUrl = json['sourceUrl']; dataSize = json['dataSize']; @@ -260,7 +270,7 @@ class SoundElem { Map toJson() { final Map data = new Map(); - data['uuID'] = this.uuID; + data['uuid'] = this.uuid; data['soundPath'] = this.soundPath; data['sourceUrl'] = this.sourceUrl; data['dataSize'] = this.dataSize; @@ -332,17 +342,17 @@ class VideoElem { class FileElem { String? filePath; - String? uuID; + String? uuid; String? sourceUrl; String? fileName; int? fileSize; FileElem( - {this.filePath, this.uuID, this.sourceUrl, this.fileName, this.fileSize}); + {this.filePath, this.uuid, this.sourceUrl, this.fileName, this.fileSize}); FileElem.fromJson(Map json) { filePath = json['filePath']; - uuID = json['uuID']; + uuid = json['uuid']; sourceUrl = json['sourceUrl']; fileName = json['fileName']; fileSize = json['fileSize']; @@ -351,7 +361,7 @@ class FileElem { Map toJson() { final Map data = new Map(); data['filePath'] = this.filePath; - data['uuID'] = this.uuID; + data['uuid'] = this.uuid; data['sourceUrl'] = this.sourceUrl; data['fileName'] = this.fileName; data['fileSize'] = this.fileSize; @@ -485,6 +495,25 @@ class MergeElem { } } +class NotificationElem { + String? detail; + String? defaultTips; + + NotificationElem({this.detail, this.defaultTips}); + + NotificationElem.fromJson(Map json) { + detail = json['detail']; + defaultTips = json['defaultTips']; + } + + Map toJson() { + final Map data = new Map(); + data['detail'] = this.detail; + data['defaultTips'] = this.defaultTips; + return data; + } +} + class HaveReadInfo { String? uid; List? msgIDList; @@ -523,3 +552,32 @@ class HaveReadInfo { return data; } } + +class OfflinePushInfo { + String? title; + String? desc; + String? ex; + String? iOSPushSound; + bool? iOSBadgeCount; + + OfflinePushInfo( + {this.title, this.desc, this.ex, this.iOSPushSound, this.iOSBadgeCount}); + + OfflinePushInfo.fromJson(Map json) { + title = json['title']; + desc = json['desc']; + ex = json['ex']; + iOSPushSound = json['iOSPushSound']; + iOSBadgeCount = json['iOSBadgeCount']; + } + + Map toJson() { + final Map data = new Map(); + data['title'] = this.title; + data['desc'] = this.desc; + data['ex'] = this.ex; + data['iOSPushSound'] = this.iOSPushSound; + data['iOSBadgeCount'] = this.iOSBadgeCount; + return data; + } +} diff --git a/lib/src/models/user_info.dart b/lib/src/models/user_info.dart index 8d67d3d..aa13e20 100644 --- a/lib/src/models/user_info.dart +++ b/lib/src/models/user_info.dart @@ -1,91 +1,388 @@ +/// Is a friend not in the blacklist +/// 是好友不在黑名单 +/// Not a friend on the blacklist +/// 不是好友在黑名单 +/// Not a friend is not on the blacklist +/// 不是好友不在黑名单 class UserInfo { - String uid; - String? name; - String? icon; + String? userID; + String? nickname; + String? faceURL; int? gender; - String? mobile; - String? birth; + String? phoneNumber; + int? birth; String? email; String? ex; - String? comment; - int? isInBlackList; - String? reqMessage; - String? applyTime; - int? flag; - - UserInfo( - {required this.uid, - this.name, - this.icon, - this.gender, - this.mobile, - this.birth, - this.email, - this.ex, - this.comment, - this.isInBlackList, - this.reqMessage, - this.applyTime, - this.flag}); - - UserInfo.fromJson(Map json) : uid = json['uid'] { - name = json['name']; - icon = json['icon']; + int? createTime; + String? remark; + + PublicUserInfo? publicInfo; + FriendInfo? friendInfo; + BlacklistInfo? blackInfo; + + bool? isFriendship; + bool? isBlacklist; + + UserInfo({ + this.publicInfo, + this.friendInfo, + this.blackInfo, + this.isFriendship, + this.isBlacklist, + // + this.userID, + this.nickname, + this.faceURL, + this.phoneNumber, + this.birth, + this.gender, + this.email, + this.ex, + this.createTime, + this.remark, + }); + + // UserInfo.self(Map json) { + // userID = json['userID']; + // nickname = json['nickname']; + // faceURL = json['faceURL']; + // gender = json['gender']; + // phoneNumber = json['phoneNumber']; + // birth = json['birth']; + // email = json['email']; + // ex = json['ex']; + // createTime = json['createTime']; + // } + + UserInfo.fromJson(Map json) { + publicInfo = json['publicInfo'] != null + ? PublicUserInfo.fromJson(json['publicInfo']) + : null; + friendInfo = json['friendInfo'] != null + ? FriendInfo.fromJson(json['friendInfo']) + : null; + blackInfo = json['blackInfo'] != null + ? BlacklistInfo.fromJson(json['blackInfo']) + : null; + // + isFriendship = friendInfo != null; + isBlacklist = blackInfo != null; + + userID = json['userID'] ?? _userID; + nickname = json['nickname'] ?? _nickname; + faceURL = json['faceURL'] ?? _faceUrl; + gender = json['gender'] ?? _gender; + phoneNumber = json['phoneNumber'] ?? _phoneNumber; + birth = json['birth'] ?? _birth; + email = json['email'] ?? _email; + remark = json['remark'] ?? _remark; + ex = json['ex']; + createTime = json['createTime']; + } + + Map toJson() { + final data = Map(); + data['publicInfo'] = this.publicInfo?.toJson(); + data['friendInfo'] = this.friendInfo?.toJson(); + data['blackInfo'] = this.blackInfo?.toJson(); + // + data['isFriendship'] = this.isFriendship; + data['isBlacklist'] = this.isBlacklist; + data['userID'] = this.userID; + data['nickname'] = this.nickname; + data['faceURL'] = this.faceURL; + data['gender'] = this.gender; + data['phoneNumber'] = this.phoneNumber; + data['birth'] = this.birth; + data['email'] = this.email; + data['ex'] = this.ex; + data['createTime'] = this.createTime; + data['remark'] = this.remark; + return data; + } + + // bool get isFriendship => null != friendInfo; + // + // bool get isBlacklist => null != blackInfo; + + bool get isMale => gender == 1; + + String get _userID => isFriendship! + ? friendInfo!.userID! + : (isBlacklist! ? blackInfo!.userID! : publicInfo!.userID!); + + String? get _nickname => isFriendship! + ? friendInfo?.nickname + : (isBlacklist! ? blackInfo?.nickname : publicInfo?.nickname); + + String? get _faceUrl => isFriendship! + ? friendInfo?.faceURL + : (isBlacklist! ? blackInfo?.faceURL : publicInfo?.faceURL); + + int? get _gender => isFriendship! + ? friendInfo?.gender + : (isBlacklist! ? blackInfo?.gender : publicInfo?.gender); + + String? get _phoneNumber => friendInfo?.phoneNumber; + + int? get _birth => friendInfo?.birth; + + String? get _email => friendInfo?.email; + + String? get _remark => friendInfo?.remark; + + String getShowName() => _trimBlank(remark) ?? _trimBlank(nickname) ?? userID!; + + static String? _trimBlank(String? value) { + if (value == null || value.trim().isEmpty) return null; + return value; + } +} + +class PublicUserInfo { + String? userID; + String? nickname; + String? faceURL; + int? gender; + int? appMangerLevel; + + PublicUserInfo({ + this.userID, + this.nickname, + this.faceURL, + this.gender, + this.appMangerLevel, + }); + + PublicUserInfo.fromJson(Map json) { + userID = json['userID']; + nickname = json['nickname']; + faceURL = json['faceURL']; gender = json['gender']; - mobile = json['mobile']; + appMangerLevel = json['appMangerLevel']; + } + + Map toJson() { + final data = Map(); + data['userID'] = this.userID; + data['nickname'] = this.nickname; + data['faceURL'] = this.faceURL; + data['gender'] = this.gender; + data['appMangerLevel'] = this.appMangerLevel; + return data; + } +} + +class FriendInfo { + String? userID; + String? nickname; + String? faceURL; + int? gender; + String? phoneNumber; + int? birth; + String? email; + String? remark; + String? ex; + int? createTime; + int? addSource; + String? operatorUserID; + + FriendInfo({ + this.userID, + this.nickname, + this.faceURL, + this.gender, + this.phoneNumber, + this.birth, + this.email, + this.remark, + this.ex, + this.createTime, + this.addSource, + this.operatorUserID, + }); + + FriendInfo.fromJson(Map json) { + // ownerUserID = json['ownerUserID']; + userID = json['userID']; + remark = json['remark']; + createTime = json['createTime']; + addSource = json['addSource']; + operatorUserID = json['operatorUserID']; + nickname = json['nickname']; + faceURL = json['faceURL']; + gender = json['gender']; + phoneNumber = json['phoneNumber']; birth = json['birth']; email = json['email']; ex = json['ex']; - comment = json['comment']; - isInBlackList = json['isInBlackList']; - reqMessage = json['reqMessage']; - applyTime = json['applyTime']; - flag = json['flag']; } Map toJson() { - final Map data = new Map(); - data['uid'] = this.uid; - data['name'] = this.name; - data['icon'] = this.icon; + final data = Map(); + // data['ownerUserID'] = this.ownerUserID; + data['userID'] = this.userID; + data['remark'] = this.remark; + data['createTime'] = this.createTime; + data['addSource'] = this.addSource; + data['operatorUserID'] = this.operatorUserID; + data['nickname'] = this.nickname; + data['faceURL'] = this.faceURL; data['gender'] = this.gender; - data['mobile'] = this.mobile; + data['phoneNumber'] = this.phoneNumber; data['birth'] = this.birth; data['email'] = this.email; data['ex'] = this.ex; - data['comment'] = this.comment; - data['isInBlackList'] = this.isInBlackList; - data['reqMessage'] = this.reqMessage; - data['applyTime'] = this.applyTime; - data['flag'] = this.flag; return data; } +} + +class BlacklistInfo { + String? userID; + String? nickname; + String? faceURL; + int? gender; + int? createTime; + int? addSource; + String? operatorUserID; + String? ex; - String getShowName() { - if (null != comment && comment!.trim().isNotEmpty) { - return comment!; - } else if (null != name && name!.trim().isNotEmpty) { - return name!; - } - return uid; + BlacklistInfo({ + this.userID, + this.nickname, + this.faceURL, + this.gender, + this.createTime, + this.addSource, + this.operatorUserID, + this.ex, + }); + + BlacklistInfo.fromJson(Map json) { + userID = json['userID']; + nickname = json['nickname']; + faceURL = json['faceURL']; + gender = json['gender']; + createTime = json['createTime']; + addSource = json['addSource']; + operatorUserID = json['operatorUserID']; + ex = json['ex']; + } + + Map toJson() { + final data = Map(); + data['userID'] = this.userID; + data['nickname'] = this.nickname; + data['faceURL'] = this.faceURL; + data['gender'] = this.gender; + data['createTime'] = this.createTime; + data['addSource'] = this.addSource; + data['operatorUserID'] = this.operatorUserID; + data['ex'] = this.ex; + return data; } +} - bool get isMan => gender == 1; +class FriendshipInfo { + String? userID; - bool get isWoman => gender == 2; + /// 1 means friend (and not blacklist) + /// 1表示好友(并且不是黑名单) + int? result; - /// blacklist - bool get isBlocked => isInBlackList == 1; + FriendshipInfo({this.userID, this.result}); + + FriendshipInfo.fromJson(Map json) { + userID = json['userID']; + result = json['result']; + } + + Map toJson() { + final Map data = new Map(); + data['userID'] = this.userID; + data['result'] = this.result; + return data; + } +} + +class FriendApplicationInfo { + String? fromUserID; + String? fromNickname; + String? fromFaceURL; + int? fromGender; + String? toUserID; + String? toNickname; + String? toFaceURL; + int? toGender; + int? handleResult; + String? reqMsg; + int? createTime; + String? handlerUserID; + String? handleMsg; + int? handleTime; + String? ex; + + FriendApplicationInfo( + {this.fromUserID, + this.fromNickname, + this.fromFaceURL, + this.fromGender, + this.toUserID, + this.toNickname, + this.toFaceURL, + this.toGender, + this.handleResult, + this.reqMsg, + this.createTime, + this.handlerUserID, + this.handleMsg, + this.handleTime, + this.ex}); + + FriendApplicationInfo.fromJson(Map json) { + fromUserID = json['fromUserID']; + fromNickname = json['fromNickname']; + fromFaceURL = json['fromFaceURL']; + fromGender = json['fromGender']; + toUserID = json['toUserID']; + toNickname = json['toNickname']; + toFaceURL = json['toFaceURL']; + toGender = json['toGender']; + handleResult = json['handleResult']; + reqMsg = json['reqMsg']; + createTime = json['createTime']; + handlerUserID = json['handlerUserID']; + handleMsg = json['handleMsg']; + handleTime = json['handleTime']; + ex = json['ex']; + } + + Map toJson() { + final data = Map(); + data['fromUserID'] = this.fromUserID; + data['fromNickname'] = this.fromNickname; + data['fromFaceURL'] = this.fromFaceURL; + data['fromGender'] = this.fromGender; + data['toUserID'] = this.toUserID; + data['toNickname'] = this.toNickname; + data['toFaceURL'] = this.toFaceURL; + data['toGender'] = this.toGender; + data['handleResult'] = this.handleResult; + data['reqMsg'] = this.reqMsg; + data['createTime'] = this.createTime; + data['handlerUserID'] = this.handlerUserID; + data['handleMsg'] = this.handleMsg; + data['handleTime'] = this.handleTime; + data['ex'] = this.ex; + return data; + } /// friend application waiting handle - bool get isWaitingHandle => flag == 0; + bool get isWaitingHandle => handleResult == 0; /// friend application agreed - bool get isAgreed => flag == 1; + bool get isAgreed => handleResult == 1; /// friend application rejected - bool get isRejected => flag == -1; - - /// exist friendship - bool get isFriendship => isAgreed; + bool get isRejected => handleResult == -1; }