This commit is contained in:
parent
9f57971ee9
commit
6a446a7b33
@ -1,3 +1,7 @@
|
|||||||
|
## 3.8.1
|
||||||
|
|
||||||
|
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.1)
|
||||||
|
|
||||||
## 3.8.1-rc.0
|
## 3.8.1-rc.0
|
||||||
|
|
||||||
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.1-rc.0)
|
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.1-rc.0)
|
||||||
@ -9,7 +13,7 @@
|
|||||||
## 3.8.0-rc.16
|
## 3.8.0-rc.16
|
||||||
|
|
||||||
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.0-rc.16)
|
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.0-rc.16)
|
||||||
|
|
||||||
## 3.5.1
|
## 3.5.1
|
||||||
|
|
||||||
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.5.1)
|
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.5.1)
|
||||||
|
@ -52,5 +52,5 @@ android {
|
|||||||
dependencies {
|
dependencies {
|
||||||
// 本地依赖,现将aar复制到libs/io/openim/core-sdk/0.0.1/ 下,命名core-sdk-0.0.1.aar
|
// 本地依赖,现将aar复制到libs/io/openim/core-sdk/0.0.1/ 下,命名core-sdk-0.0.1.aar
|
||||||
// implementation 'io.openim:core-sdk:0.0.1@aar'
|
// implementation 'io.openim:core-sdk:0.0.1@aar'
|
||||||
implementation 'io.openim:core-sdk:3.8.1-rc.0@aar'
|
implementation 'io.openim:core-sdk:3.8.1@aar'
|
||||||
}
|
}
|
@ -37,42 +37,6 @@ public class OnAdvancedMsgListener implements open_im_sdk_callback.OnAdvancedMsg
|
|||||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvC2CReadReceipt", values);
|
CommonUtil.emitEvent("advancedMsgListener", "onRecvC2CReadReceipt", values);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onRecvGroupReadReceipt(String s) {
|
|
||||||
final Map<String, String> values = new ArrayMap<>();
|
|
||||||
values.put("id", id);
|
|
||||||
values.put("groupMsgReceiptList", s);
|
|
||||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvGroupReadReceipt", values);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onRecvMessageExtensionsAdded(String s, String s1) {
|
|
||||||
final Map<String, String> values = new ArrayMap<>();
|
|
||||||
values.put("id", id);
|
|
||||||
values.put("msgID", s);
|
|
||||||
values.put("reactionExtensionList", s1);
|
|
||||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageExtensionsAdded", values);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onRecvMessageExtensionsChanged(String s, String s1) {
|
|
||||||
final Map<String, String> values = new ArrayMap<>();
|
|
||||||
values.put("id", id);
|
|
||||||
values.put("msgID", s);
|
|
||||||
values.put("reactionExtensionList", s1);
|
|
||||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageExtensionsChanged", values);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onRecvMessageExtensionsDeleted(String s, String s1) {
|
|
||||||
final Map<String, String> values = new ArrayMap<>();
|
|
||||||
values.put("id", id);
|
|
||||||
values.put("msgID", s);
|
|
||||||
values.put("reactionExtensionKeyList", s1);
|
|
||||||
CommonUtil.emitEvent("advancedMsgListener", "onRecvMessageExtensionsDeleted", values);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onRecvNewMessage(String s) {
|
public void onRecvNewMessage(String s) {
|
||||||
final Map<String, String> values = new ArrayMap<>();
|
final Map<String, String> values = new ArrayMap<>();
|
||||||
|
@ -19,13 +19,15 @@ public class OnBaseListener implements Base {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onError(int l, String s) {
|
public void onError(int l, String s) {
|
||||||
Log.i("F-OpenIMSDK(native call flutter)", "method: 【 " + call.method + " 】, onError: { code:" + l + ", message:" + s + "}");
|
String threadName = Thread.currentThread().getName();
|
||||||
|
Log.i("F-OpenIMSDK(native call flutter)", "thread: " + threadName + " method: 【 " + call.method + " 】, onError: { code:" + l + ", message:" + s + "}");
|
||||||
CommonUtil.runMainThreadReturnError(result, l, s, null);
|
CommonUtil.runMainThreadReturnError(result, l, s, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(String s) {
|
public void onSuccess(String s) {
|
||||||
Log.i("F-OpenIMSDK(native call flutter)", "method: 【 " + call.method + " 】, onSuccess: " + s);
|
String threadName = Thread.currentThread().getName();
|
||||||
|
Log.i("F-OpenIMSDK(native call flutter)", "thread: " + threadName + " method: 【 " + call.method + " 】, onSuccess: " + s);
|
||||||
CommonUtil.runMainThreadReturn(result, s);
|
CommonUtil.runMainThreadReturn(result, s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -24,66 +24,6 @@
|
|||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// @Override
|
// @Override
|
||||||
// public void onHangUp(String s) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onInvitationCancelled(String s) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onInvitationTimeout(String s) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onInviteeAccepted(String s) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onInviteeAcceptedByOtherDevice(String s) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onInviteeRejected(String s) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onInviteeRejectedByOtherDevice(String s) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onReceiveCustomSignal(String s) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onReceiveNewInvitation(String s) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onRoomParticipantConnected(String s) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onRoomParticipantDisconnected(String s) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onStreamChange(String s) {
|
|
||||||
//
|
|
||||||
// }
|
|
||||||
//
|
|
||||||
// @Override
|
|
||||||
// public void onRecvNewMessage(String s) {
|
// public void onRecvNewMessage(String s) {
|
||||||
// CommonUtil.emitEvent("listenerForService", "onRecvNewMessage", s);
|
// CommonUtil.emitEvent("listenerForService", "onRecvNewMessage", s);
|
||||||
// }
|
// }
|
||||||
|
@ -59,15 +59,6 @@ public class ConversationManager extends BaseManager {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void pinConversation(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
Open_im_sdk.pinConversation(
|
|
||||||
new OnBaseListener(result, methodCall),
|
|
||||||
value(methodCall, "operationID"),
|
|
||||||
value(methodCall, "conversationID"),
|
|
||||||
value(methodCall, "isPinned")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void hideConversation(MethodCall methodCall, MethodChannel.Result result) {
|
public void hideConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.hideConversation(
|
Open_im_sdk.hideConversation(
|
||||||
new OnBaseListener(result, methodCall),
|
new OnBaseListener(result, methodCall),
|
||||||
@ -98,32 +89,6 @@ public class ConversationManager extends BaseManager {
|
|||||||
int2long(methodCall, "sessionType")));
|
int2long(methodCall, "sessionType")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
Open_im_sdk.setConversationRecvMessageOpt(
|
|
||||||
new OnBaseListener(result, methodCall),
|
|
||||||
value(methodCall, "operationID"),
|
|
||||||
value(methodCall, "conversationID"),
|
|
||||||
int2long(methodCall, "status")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void getConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
Open_im_sdk.getConversationRecvMessageOpt(
|
|
||||||
new OnBaseListener(result, methodCall),
|
|
||||||
value(methodCall, "operationID"),
|
|
||||||
jsonValue(methodCall, "conversationIDList")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConversationPrivateChat(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
Open_im_sdk.setConversationPrivateChat(
|
|
||||||
new OnBaseListener(result, methodCall),
|
|
||||||
value(methodCall, "operationID"),
|
|
||||||
value(methodCall, "conversationID"),
|
|
||||||
value(methodCall, "isPrivate")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void clearConversationAndDeleteAllMsg(MethodCall methodCall, MethodChannel.Result result) {
|
public void clearConversationAndDeleteAllMsg(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.clearConversationAndDeleteAllMsg(
|
Open_im_sdk.clearConversationAndDeleteAllMsg(
|
||||||
new OnBaseListener(result, methodCall),
|
new OnBaseListener(result, methodCall),
|
||||||
@ -140,56 +105,10 @@ public class ConversationManager extends BaseManager {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void deleteAllConversationFromLocal(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public void resetConversationGroupAtType(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
Open_im_sdk.resetConversationGroupAtType(
|
|
||||||
new OnBaseListener(result, methodCall),
|
|
||||||
value(methodCall, "operationID"),
|
|
||||||
value(methodCall, "conversationID")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void getAtAllTag(MethodCall methodCall, MethodChannel.Result result) {
|
public void getAtAllTag(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
CommonUtil.runMainThreadReturn(result, Open_im_sdk.getAtAllTag(value(methodCall, "operationID")));
|
CommonUtil.runMainThreadReturn(result, Open_im_sdk.getAtAllTag(value(methodCall, "operationID")));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGlobalRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
Open_im_sdk.setGlobalRecvMessageOpt(
|
|
||||||
new OnBaseListener(result, methodCall),
|
|
||||||
value(methodCall, "operationID"),
|
|
||||||
int2long(methodCall, "status")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConversationBurnDuration(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
Open_im_sdk.setConversationBurnDuration(
|
|
||||||
new OnBaseListener(result, methodCall),
|
|
||||||
value(methodCall, "operationID"),
|
|
||||||
value(methodCall, "conversationID"),
|
|
||||||
value(methodCall, "burnDuration")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConversationIsMsgDestruct(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
Open_im_sdk.setConversationIsMsgDestruct(
|
|
||||||
new OnBaseListener(result, methodCall),
|
|
||||||
value(methodCall, "operationID"),
|
|
||||||
value(methodCall, "conversationID"),
|
|
||||||
value(methodCall, "isMsgDestruct")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setConversationMsgDestructTime(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
Open_im_sdk.setConversationMsgDestructTime(
|
|
||||||
new OnBaseListener(result, methodCall),
|
|
||||||
value(methodCall, "operationID"),
|
|
||||||
value(methodCall, "conversationID"),
|
|
||||||
int2long(methodCall, "duration")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void hideAllConversations(MethodCall methodCall, MethodChannel.Result result) {
|
public void hideAllConversations(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.hideAllConversations(
|
Open_im_sdk.hideAllConversations(
|
||||||
new OnBaseListener(result, methodCall),
|
new OnBaseListener(result, methodCall),
|
||||||
@ -205,15 +124,6 @@ public class ConversationManager extends BaseManager {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setConversationEx(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
Open_im_sdk.setConversationEx(
|
|
||||||
new OnBaseListener(result, methodCall),
|
|
||||||
value(methodCall, "operationID"),
|
|
||||||
value(methodCall, "conversationID"),
|
|
||||||
value(methodCall, "ex")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void changeInputStates(MethodCall methodCall, MethodChannel.Result result) {
|
public void changeInputStates(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.changeInputStates(
|
Open_im_sdk.changeInputStates(
|
||||||
new OnBaseListener(result, methodCall),
|
new OnBaseListener(result, methodCall),
|
||||||
@ -231,4 +141,22 @@ public class ConversationManager extends BaseManager {
|
|||||||
value(methodCall, "userID")
|
value(methodCall, "userID")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setConversation(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.setConversation(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "conversationID"),
|
||||||
|
jsonValue(methodCall, "req")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public void searchConversations(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.searchConversation(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "name")
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,8 @@ public class FriendshipManager extends BaseManager {
|
|||||||
Open_im_sdk.getSpecifiedFriendsInfo(
|
Open_im_sdk.getSpecifiedFriendsInfo(
|
||||||
new OnBaseListener(result, methodCall),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall, "userIDList")
|
jsonValue(methodCall, "userIDList"),
|
||||||
|
value(methodCall, "filterBlack")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +49,8 @@ public class FriendshipManager extends BaseManager {
|
|||||||
public void getFriendList(MethodCall methodCall, MethodChannel.Result result) {
|
public void getFriendList(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getFriendList(
|
Open_im_sdk.getFriendList(
|
||||||
new OnBaseListener(result, methodCall),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID")
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "filterBlack")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,15 +59,8 @@ public class FriendshipManager extends BaseManager {
|
|||||||
new OnBaseListener(result, methodCall),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
value(methodCall, "offset"),
|
value(methodCall, "offset"),
|
||||||
value(methodCall, "count")
|
value(methodCall, "count"),
|
||||||
);
|
value(methodCall, "filterBlack")
|
||||||
}
|
|
||||||
|
|
||||||
public void setFriendRemark(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
Open_im_sdk.setFriendRemark(
|
|
||||||
new OnBaseListener(result, methodCall),
|
|
||||||
value(methodCall, "operationID"),
|
|
||||||
jsonValue(methodCall)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,12 +128,11 @@ public class FriendshipManager extends BaseManager {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFriendsEx(MethodCall methodCall, MethodChannel.Result result) {
|
public void updateFriends(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.setFriendsEx(
|
Open_im_sdk.updateFriends(
|
||||||
new OnBaseListener(result, methodCall),
|
new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall, "friendIDs"),
|
jsonValue(methodCall, "req")
|
||||||
value(methodCall, "ex")
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -186,15 +186,6 @@ public class GroupManager extends BaseManager {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGroupMemberNickname(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
Open_im_sdk.setGroupMemberNickname(new OnBaseListener(result, methodCall),
|
|
||||||
value(methodCall, "operationID"),
|
|
||||||
value(methodCall, "groupID"),
|
|
||||||
value(methodCall, "userID"),
|
|
||||||
value(methodCall, "groupNickname")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void searchGroups(MethodCall methodCall, MethodChannel.Result result) {
|
public void searchGroups(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.searchGroups(new OnBaseListener(result, methodCall),
|
Open_im_sdk.searchGroups(new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
@ -202,15 +193,6 @@ public class GroupManager extends BaseManager {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGroupMemberRoleLevel(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
Open_im_sdk.setGroupMemberRoleLevel(new OnBaseListener(result, methodCall),
|
|
||||||
value(methodCall, "operationID"),
|
|
||||||
value(methodCall, "groupID"),
|
|
||||||
value(methodCall, "userID"),
|
|
||||||
int2long(methodCall, "roleLevel")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void getGroupMemberListByJoinTimeFilter(MethodCall methodCall, MethodChannel.Result result) {
|
public void getGroupMemberListByJoinTimeFilter(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getGroupMemberListByJoinTimeFilter(new OnBaseListener(result, methodCall),
|
Open_im_sdk.getGroupMemberListByJoinTimeFilter(new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
@ -223,30 +205,6 @@ public class GroupManager extends BaseManager {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGroupVerification(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
Open_im_sdk.setGroupVerification(new OnBaseListener(result, methodCall),
|
|
||||||
value(methodCall, "operationID"),
|
|
||||||
value(methodCall, "groupID"),
|
|
||||||
value(methodCall, "needVerification")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGroupLookMemberInfo(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
Open_im_sdk.setGroupLookMemberInfo(new OnBaseListener(result, methodCall),
|
|
||||||
value(methodCall, "operationID"),
|
|
||||||
value(methodCall, "groupID"),
|
|
||||||
value(methodCall, "status")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGroupApplyMemberFriend(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
Open_im_sdk.setGroupApplyMemberFriend(new OnBaseListener(result, methodCall),
|
|
||||||
value(methodCall, "operationID"),
|
|
||||||
value(methodCall, "groupID"),
|
|
||||||
value(methodCall, "status")
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void getGroupMemberOwnerAndAdmin(MethodCall methodCall, MethodChannel.Result result) {
|
public void getGroupMemberOwnerAndAdmin(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.getGroupMemberOwnerAndAdmin(new OnBaseListener(result, methodCall),
|
Open_im_sdk.getGroupMemberOwnerAndAdmin(new OnBaseListener(result, methodCall),
|
||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
|
@ -73,6 +73,19 @@ public class IMManager extends BaseManager {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void logs(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.logs(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
int2long(methodCall, "logLevel"),
|
||||||
|
value(methodCall, "file"),
|
||||||
|
int2long(methodCall, "line"),
|
||||||
|
value(methodCall, "msgs"),
|
||||||
|
value(methodCall, "err"),
|
||||||
|
value(methodCall, "keyAndValue")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public void setAppBackgroundStatus(MethodCall methodCall, MethodChannel.Result result) {
|
public void setAppBackgroundStatus(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.setAppBackgroundStatus(
|
Open_im_sdk.setAppBackgroundStatus(
|
||||||
new OnBaseListener(result, methodCall),
|
new OnBaseListener(result, methodCall),
|
||||||
|
@ -61,20 +61,4 @@ public class UserManager extends BaseManager {
|
|||||||
value(methodCall, "operationID"),
|
value(methodCall, "operationID"),
|
||||||
jsonValue(methodCall, "userIDs"));
|
jsonValue(methodCall, "userIDs"));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void getUsersInfoWithCache(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
Open_im_sdk.getUsersInfoWithCache(
|
|
||||||
new OnBaseListener(result, methodCall),
|
|
||||||
value(methodCall, "operationID"),
|
|
||||||
jsonValue(methodCall, "userIDs"),
|
|
||||||
value(methodCall, "groupID"));
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
public void setSelfInfoEx(MethodCall methodCall, MethodChannel.Result result) {
|
|
||||||
Open_im_sdk.setSelfInfoEx(
|
|
||||||
new OnBaseListener(result, methodCall),
|
|
||||||
value(methodCall, "operationID"),
|
|
||||||
jsonValue(methodCall));
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ public class CommonUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public synchronized static <T> void emitEvent(String method, String type, Object errCode, String errMsg, T data) {
|
public synchronized static <T> void emitEvent(String method, String type, Object errCode, String errMsg, T data) {
|
||||||
|
String threadName = Thread.currentThread().getName();
|
||||||
runMainThread(() -> {
|
runMainThread(() -> {
|
||||||
Map<String, Object> res = new ArrayMap<>();
|
Map<String, Object> res = new ArrayMap<>();
|
||||||
if (null != type) {
|
if (null != type) {
|
||||||
@ -47,7 +48,7 @@ public class CommonUtil {
|
|||||||
if (null != errMsg) {
|
if (null != errMsg) {
|
||||||
res.put("errMsg", errMsg);
|
res.put("errMsg", errMsg);
|
||||||
}
|
}
|
||||||
Log.i("F-OpenIMSDK(native call flutter)", "{ method:" + method + ", type:" + type + " }");
|
Log.i("F-OpenIMSDK(native call flutter)", "thread: " + threadName + " { method:" + method + ", type:" + type + " }");
|
||||||
FlutterOpenimSdkPlugin.channel.invokeMethod(method, res);
|
FlutterOpenimSdkPlugin.channel.invokeMethod(method, res);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -341,15 +341,14 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = BDLHL8GNFV;
|
DEVELOPMENT_TEAM = V57RT7LMFH;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = cn.rentsoft.uni;
|
PRODUCT_BUNDLE_IDENTIFIER = io.openim.sdk.example;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
@ -474,15 +473,14 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = BDLHL8GNFV;
|
DEVELOPMENT_TEAM = V57RT7LMFH;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = cn.rentsoft.uni;
|
PRODUCT_BUNDLE_IDENTIFIER = io.openim.sdk.example;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||||
@ -499,15 +497,14 @@
|
|||||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||||
CLANG_ENABLE_MODULES = YES;
|
CLANG_ENABLE_MODULES = YES;
|
||||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||||
DEVELOPMENT_TEAM = BDLHL8GNFV;
|
DEVELOPMENT_TEAM = V57RT7LMFH;
|
||||||
ENABLE_BITCODE = NO;
|
ENABLE_BITCODE = NO;
|
||||||
INFOPLIST_FILE = Runner/Info.plist;
|
INFOPLIST_FILE = Runner/Info.plist;
|
||||||
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
|
|
||||||
LD_RUNPATH_SEARCH_PATHS = (
|
LD_RUNPATH_SEARCH_PATHS = (
|
||||||
"$(inherited)",
|
"$(inherited)",
|
||||||
"@executable_path/Frameworks",
|
"@executable_path/Frameworks",
|
||||||
);
|
);
|
||||||
PRODUCT_BUNDLE_IDENTIFIER = cn.rentsoft.uni;
|
PRODUCT_BUNDLE_IDENTIFIER = io.openim.sdk.example;
|
||||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||||
SWIFT_VERSION = 5.0;
|
SWIFT_VERSION = 5.0;
|
||||||
|
@ -14,7 +14,12 @@ class _MyAppState extends State<MyApp> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
OpenIM.iMManager.initSDK(platformID: 1, apiAddr: '', wsAddr: '', dataDir: '/', listener: OnConnectListener());
|
OpenIM.iMManager.initSDK(
|
||||||
|
platformID: 1,
|
||||||
|
apiAddr: '',
|
||||||
|
wsAddr: '',
|
||||||
|
dataDir: '/',
|
||||||
|
listener: OnConnectListener());
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
@ -68,7 +68,7 @@ packages:
|
|||||||
path: ".."
|
path: ".."
|
||||||
relative: true
|
relative: true
|
||||||
source: path
|
source: path
|
||||||
version: "3.8.0"
|
version: "3.8.1"
|
||||||
flutter_test:
|
flutter_test:
|
||||||
dependency: "direct dev"
|
dependency: "direct dev"
|
||||||
description: flutter
|
description: flutter
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter_test/flutter_test.dart';
|
import 'package:flutter_test/flutter_test.dart';
|
||||||
|
|
||||||
import 'package:flutter_openim_sdk_example/main.dart';
|
import '../lib/main.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
testWidgets('Verify Platform version', (WidgetTester tester) async {
|
testWidgets('Verify Platform version', (WidgetTester tester) async {
|
||||||
@ -18,8 +18,7 @@ void main() {
|
|||||||
// Verify that platform version is retrieved.
|
// Verify that platform version is retrieved.
|
||||||
expect(
|
expect(
|
||||||
find.byWidgetPredicate(
|
find.byWidgetPredicate(
|
||||||
(Widget widget) => widget is Text &&
|
(Widget widget) => widget is Text && widget.data!.startsWith('Running on:'),
|
||||||
widget.data!.startsWith('Running on:'),
|
|
||||||
),
|
),
|
||||||
findsOneWidget,
|
findsOneWidget,
|
||||||
);
|
);
|
||||||
|
@ -2,193 +2,146 @@ import Foundation
|
|||||||
import OpenIMCore
|
import OpenIMCore
|
||||||
|
|
||||||
public class ConversationManager: BaseServiceManager {
|
public class ConversationManager: BaseServiceManager {
|
||||||
|
|
||||||
public override func registerHandlers() {
|
public override func registerHandlers() {
|
||||||
super.registerHandlers()
|
super.registerHandlers()
|
||||||
self["setConversationListener"] = setConversationListener
|
self["changeInputStates"] = changeInputStates
|
||||||
self["getAllConversationList"] = getAllConversationList
|
|
||||||
self["getConversationListSplit"] = getConversationListSplit
|
|
||||||
self["getOneConversation"] = getOneConversation
|
|
||||||
self["getMultipleConversation"] = getMultipleConversation
|
|
||||||
self["setConversationDraft"] = setConversationDraft
|
|
||||||
self["pinConversation"] = pinConversation
|
|
||||||
self["hideConversation"] = hideConversation
|
|
||||||
self["markConversationMessageAsRead"] = markConversationMessageAsRead
|
|
||||||
self["getTotalUnreadMsgCount"] = getTotalUnreadMsgCount
|
|
||||||
self["getConversationIDBySessionType"] = getConversationIDBySessionType
|
|
||||||
self["setConversationRecvMessageOpt"] = setConversationRecvMessageOpt
|
|
||||||
self["getConversationRecvMessageOpt"] = getConversationRecvMessageOpt
|
|
||||||
self["setConversationPrivateChat"] = setConversationPrivateChat
|
|
||||||
self["clearConversationAndDeleteAllMsg"] = clearConversationAndDeleteAllMsg
|
self["clearConversationAndDeleteAllMsg"] = clearConversationAndDeleteAllMsg
|
||||||
self["deleteConversationAndDeleteAllMsg"] = deleteConversationAndDeleteAllMsg
|
self["deleteConversationAndDeleteAllMsg"] = deleteConversationAndDeleteAllMsg
|
||||||
self["resetConversationGroupAtType"] = resetConversationGroupAtType
|
self["getAllConversationList"] = getAllConversationList
|
||||||
self["getAtAllTag"] = getAtAllTag
|
self["getAtAllTag"] = getAtAllTag
|
||||||
self["setGlobalRecvMessageOpt"] = setGlobalRecvMessageOpt
|
self["getConversationIDBySessionType"] = getConversationIDBySessionType
|
||||||
self["setConversationBurnDuration"] = setConversationBurnDuration
|
self["getConversationListSplit"] = getConversationListSplit
|
||||||
self["setConversationIsMsgDestruct"] = setConversationIsMsgDestruct
|
|
||||||
self["setConversationMsgDestructTime"] = setConversationMsgDestructTime
|
|
||||||
self["hideAllConversations"] = hideAllConversations
|
|
||||||
self["searchConversation"] = searchConversation
|
|
||||||
self["setConversationEx"] = setConversationEx
|
|
||||||
self["changeInputStates"] = changeInputStates
|
|
||||||
self["getInputStates"] = getInputStates
|
self["getInputStates"] = getInputStates
|
||||||
}
|
self["getMultipleConversation"] = getMultipleConversation
|
||||||
|
self["getOneConversation"] = getOneConversation
|
||||||
func setConversationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
self["getTotalUnreadMsgCount"] = getTotalUnreadMsgCount
|
||||||
Open_im_sdkSetConversationListener(ConversationListener(channel: channel))
|
self["hideAllConversations"] = hideAllConversations
|
||||||
callBack(result)
|
self["hideConversation"] = hideConversation
|
||||||
}
|
self["markConversationMessageAsRead"] = markConversationMessageAsRead
|
||||||
|
self["searchConversation"] = searchConversation
|
||||||
func getAllConversationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
self["setConversationDraft"] = setConversationDraft
|
||||||
Open_im_sdkGetAllConversationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
self["setConversationListener"] = setConversationListener
|
||||||
|
self["setConversation"] = setConversation
|
||||||
|
self["searchConversations"] = searchConversations
|
||||||
}
|
}
|
||||||
|
|
||||||
func getConversationListSplit(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func changeInputStates(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
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(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int32: "sessionType"], methodCall[string: "sourceID"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func getMultipleConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkGetMultipleConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func setConversationDraft(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
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(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[bool: "isPinned"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func hideConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkHideConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func markConversationMessageAsRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkMarkConversationMessageAsRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func getTotalUnreadMsgCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkGetTotalUnreadMsgCount(BaseCallback(result: result), methodCall[string: "operationID"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func getConversationIDBySessionType(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
let conversationID = Open_im_sdkGetConversationIDBySessionType( methodCall[string: "operationID"],methodCall[string: "sourceID"], methodCall[int: "sessionType"])
|
|
||||||
callBack(result, conversationID)
|
|
||||||
}
|
|
||||||
|
|
||||||
func setConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkSetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[int: "status"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func getConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkGetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func setConversationPrivateChat(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkSetConversationPrivateChat(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"],methodCall[bool: "isPrivate"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func clearConversationAndDeleteAllMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkClearConversationAndDeleteAllMsg(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func deleteConversationAndDeleteAllMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkDeleteConversationAndDeleteAllMsg(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func deleteAllConversationFromLocal(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
}
|
|
||||||
|
|
||||||
func resetConversationGroupAtType(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkResetConversationGroupAtType(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func getAtAllTag(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
callBack(result, Open_im_sdkGetAtAllTag(methodCall[string: "operationID"]))
|
|
||||||
}
|
|
||||||
|
|
||||||
func setGlobalRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkSetGlobalRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "status"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func setConversationBurnDuration(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkSetConversationBurnDuration(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[int32: "burnDuration"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func setConversationIsMsgDestruct(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkSetConversationIsMsgDestruct(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[bool: "isMsgDestruct"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func setConversationMsgDestructTime(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkSetConversationMsgDestructTime(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[int64: "duration"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func hideAllConversations(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkHideAllConversations(BaseCallback(result: result), methodCall[string: "operationID"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func searchConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkSearchConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "name"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func setConversationEx(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkSetConversationEx(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[string: "ex"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func changeInputStates(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkChangeInputStates(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[bool: "focus"])
|
Open_im_sdkChangeInputStates(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[bool: "focus"])
|
||||||
}
|
}
|
||||||
|
|
||||||
func getInputStates(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func clearConversationAndDeleteAllMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkClearConversationAndDeleteAllMsg(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func deleteConversationAndDeleteAllMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkDeleteConversationAndDeleteAllMsg(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getAllConversationList(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkGetAllConversationList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getAtAllTag(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
callBack(result, Open_im_sdkGetAtAllTag(methodCall[string: "operationID"]))
|
||||||
|
}
|
||||||
|
|
||||||
|
func getConversationIDBySessionType(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
let conversationID = Open_im_sdkGetConversationIDBySessionType(methodCall[string: "operationID"], methodCall[string: "sourceID"], methodCall[int: "sessionType"])
|
||||||
|
callBack(result, conversationID)
|
||||||
|
}
|
||||||
|
|
||||||
|
func getConversationListSplit(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkGetConversationListSplit(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "offset"], methodCall[int: "count"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getInputStates(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
Open_im_sdkGetInputStates(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[string: "userID"])
|
Open_im_sdkGetInputStates(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[string: "userID"])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func getMultipleConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkGetMultipleConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getOneConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkGetOneConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int32: "sessionType"], methodCall[string: "sourceID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getTotalUnreadMsgCount(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkGetTotalUnreadMsgCount(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func hideAllConversations(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkHideAllConversations(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func hideConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkHideConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func markConversationMessageAsRead(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkMarkConversationMessageAsRead(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func searchConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkSearchConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "name"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func setConversationDraft(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkSetConversationDraft(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[string: "draftText"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func setConversationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkSetConversationListener(ConversationListener(channel: channel))
|
||||||
|
callBack(result)
|
||||||
|
}
|
||||||
|
|
||||||
|
func setConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkSetConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[jsonString: "req"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func searchConversations(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkSearchConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "name"])
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public class ConversationListener: NSObject, Open_im_sdk_callbackOnConversationListenerProtocol {
|
public class ConversationListener: NSObject, Open_im_sdk_callbackOnConversationListenerProtocol {
|
||||||
|
|
||||||
public func onSyncServerProgress(_ progress: Int) {
|
private let channel: FlutterMethodChannel
|
||||||
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerProgress", errCode: nil, errMsg: nil, data: progress)
|
|
||||||
}
|
init(channel: FlutterMethodChannel) {
|
||||||
|
|
||||||
|
|
||||||
private let channel:FlutterMethodChannel
|
|
||||||
|
|
||||||
init(channel:FlutterMethodChannel) {
|
|
||||||
self.channel = channel
|
self.channel = channel
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onConversationChanged(_ conversationList: String?) {
|
public func onConversationChanged(_ conversationList: String?) {
|
||||||
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onConversationChanged", errCode: nil, errMsg: nil, data: conversationList)
|
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onConversationChanged", errCode: nil, errMsg: nil, data: conversationList)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onNewConversation(_ conversationList: String?) {
|
|
||||||
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onNewConversation", errCode: nil, errMsg: nil, data: conversationList)
|
|
||||||
}
|
|
||||||
|
|
||||||
public func onSyncServerFailed(_ reinstalled: Bool) {
|
|
||||||
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerFailed", errCode: nil, errMsg: nil, data: reinstalled)
|
|
||||||
}
|
|
||||||
|
|
||||||
public func onSyncServerFinish(_ reinstalled: Bool) {
|
|
||||||
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerFinish", errCode: nil, errMsg: nil, data: reinstalled)
|
|
||||||
}
|
|
||||||
|
|
||||||
public func onSyncServerStart(_ reinstalled: Bool) {
|
|
||||||
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerStart", errCode: nil, errMsg: nil, data: reinstalled)
|
|
||||||
}
|
|
||||||
|
|
||||||
public func onTotalUnreadMessageCountChanged(_ totalUnreadCount: Int32) {
|
|
||||||
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onTotalUnreadMessageCountChanged", errCode: nil, errMsg: nil, data: totalUnreadCount)
|
|
||||||
}
|
|
||||||
|
|
||||||
public func onConversationUserInputStatusChanged(_ change: String?) {
|
public func onConversationUserInputStatusChanged(_ change: String?) {
|
||||||
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onConversationUserInputStatusChanged", errCode: nil, errMsg: nil, data: change)
|
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onConversationUserInputStatusChanged", errCode: nil, errMsg: nil, data: change)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func onNewConversation(_ conversationList: String?) {
|
||||||
|
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onNewConversation", errCode: nil, errMsg: nil, data: conversationList)
|
||||||
|
}
|
||||||
|
|
||||||
|
public func onSyncServerFailed(_ reinstalled: Bool) {
|
||||||
|
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerFailed", errCode: nil, errMsg: nil, data: reinstalled)
|
||||||
|
}
|
||||||
|
|
||||||
|
public func onSyncServerFinish(_ reinstalled: Bool) {
|
||||||
|
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerFinish", errCode: nil, errMsg: nil, data: reinstalled)
|
||||||
|
}
|
||||||
|
|
||||||
|
public func onSyncServerProgress(_ progress: Int) {
|
||||||
|
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerProgress", errCode: nil, errMsg: nil, data: progress)
|
||||||
|
}
|
||||||
|
|
||||||
|
public func onSyncServerStart(_ reinstalled: Bool) {
|
||||||
|
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerStart", errCode: nil, errMsg: nil, data: reinstalled)
|
||||||
|
}
|
||||||
|
|
||||||
|
public func onTotalUnreadMessageCountChanged(_ totalUnreadCount: Int32) {
|
||||||
|
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onTotalUnreadMessageCountChanged", errCode: nil, errMsg: nil, data: totalUnreadCount)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -5,68 +5,34 @@ public class FriendshipManager: BaseServiceManager {
|
|||||||
|
|
||||||
public override func registerHandlers() {
|
public override func registerHandlers() {
|
||||||
super.registerHandlers()
|
super.registerHandlers()
|
||||||
self["setFriendListener"] = setFriendListener
|
self["acceptFriendApplication"] = acceptFriendApplication
|
||||||
self["getFriendsInfo"] = getFriendsInfo
|
|
||||||
self["addFriend"] = addFriend
|
|
||||||
self["getFriendApplicationListAsRecipient"] = getFriendApplicationListAsRecipient
|
|
||||||
self["getFriendApplicationListAsApplicant"] = getFriendApplicationListAsApplicant
|
|
||||||
self["getFriendList"] = getFriendList
|
|
||||||
self["getFriendListPage"] = getFriendListPage
|
|
||||||
self["setFriendRemark"] = setFriendRemark
|
|
||||||
self["addBlacklist"] = addBlacklist
|
self["addBlacklist"] = addBlacklist
|
||||||
self["getBlacklist"] = getBlacklist
|
self["addFriend"] = addFriend
|
||||||
self["removeBlacklist"] = removeBlacklist
|
|
||||||
self["checkFriend"] = checkFriend
|
self["checkFriend"] = checkFriend
|
||||||
self["deleteFriend"] = deleteFriend
|
self["deleteFriend"] = deleteFriend
|
||||||
self["acceptFriendApplication"] = acceptFriendApplication
|
self["getBlacklist"] = getBlacklist
|
||||||
|
self["getFriendApplicationListAsApplicant"] = getFriendApplicationListAsApplicant
|
||||||
|
self["getFriendApplicationListAsRecipient"] = getFriendApplicationListAsRecipient
|
||||||
|
self["getFriendList"] = getFriendList
|
||||||
|
self["getFriendListPage"] = getFriendListPage
|
||||||
|
self["getFriendsInfo"] = getFriendsInfo
|
||||||
self["refuseFriendApplication"] = refuseFriendApplication
|
self["refuseFriendApplication"] = refuseFriendApplication
|
||||||
|
self["removeBlacklist"] = removeBlacklist
|
||||||
self["searchFriends"] = searchFriends
|
self["searchFriends"] = searchFriends
|
||||||
self["setFriendsEx"] = setFriendsEx
|
self["setFriendListener"] = setFriendListener
|
||||||
|
self["updateFriends"] = updateFriends
|
||||||
}
|
}
|
||||||
|
|
||||||
func setFriendListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func acceptFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkSetFriendListener(FriendshipListener(channel: channel))
|
Open_im_sdkAcceptFriendApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||||
callBack(result)
|
|
||||||
}
|
|
||||||
|
|
||||||
func getFriendsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkGetSpecifiedFriendsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDList"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func addFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkAddFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
|
||||||
}
|
|
||||||
|
|
||||||
func getFriendApplicationListAsRecipient(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkGetFriendApplicationListAsRecipient(BaseCallback(result: result), methodCall[string: "operationID"])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func getFriendApplicationListAsApplicant(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkGetFriendApplicationListAsApplicant(BaseCallback(result: result), methodCall[string: "operationID"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func getFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkGetFriendList(BaseCallback(result: result), methodCall[string: "operationID"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func getFriendListPage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkGetFriendListPage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int32: "offset"], methodCall[int32: "count"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func setFriendRemark(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkSetFriendRemark(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
|
||||||
}
|
|
||||||
|
|
||||||
func addBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func addBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkAddBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[string: "ex"])
|
Open_im_sdkAddBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[string: "ex"])
|
||||||
}
|
}
|
||||||
|
|
||||||
func getBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func addFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkGetBlackList(BaseCallback(result: result), methodCall[string: "operationID"])
|
Open_im_sdkAddFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||||
}
|
|
||||||
|
|
||||||
func removeBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkRemoveBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func checkFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func checkFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
@ -77,20 +43,49 @@ public class FriendshipManager: BaseServiceManager {
|
|||||||
Open_im_sdkDeleteFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
Open_im_sdkDeleteFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
||||||
}
|
}
|
||||||
|
|
||||||
func acceptFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func getBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkAcceptFriendApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
Open_im_sdkGetBlackList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getFriendApplicationListAsApplicant(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkGetFriendApplicationListAsApplicant(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getFriendApplicationListAsRecipient(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkGetFriendApplicationListAsRecipient(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getFriendList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkGetFriendList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[bool: "filterBlack"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getFriendListPage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkGetFriendListPage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int32: "offset"], methodCall[int32: "count"], methodCall[bool: "filterBlack"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getFriendsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkGetSpecifiedFriendsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDList"], methodCall[bool: "filterBlack"])
|
||||||
}
|
}
|
||||||
|
|
||||||
func refuseFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func refuseFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkRefuseFriendApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
Open_im_sdkRefuseFriendApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func removeBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkRemoveBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
||||||
|
}
|
||||||
|
|
||||||
func searchFriends(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func searchFriends(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkSearchFriends(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"])
|
Open_im_sdkSearchFriends(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"])
|
||||||
}
|
}
|
||||||
|
|
||||||
func setFriendsEx(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func setFriendListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkSetFriendsEx(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "friendIDs"], methodCall[string: "ex"])
|
Open_im_sdkSetFriendListener(FriendshipListener(channel: channel))
|
||||||
|
callBack(result)
|
||||||
|
}
|
||||||
|
|
||||||
|
func updateFriends(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkUpdateFriends(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "req"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,4 +132,3 @@ public class FriendshipListener: NSObject, Open_im_sdk_callbackOnFriendshipListe
|
|||||||
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendInfoChanged", errCode: nil, errMsg: nil, data: friendInfo)
|
CommonUtil.emitEvent(channel: channel, method: "friendListener", type: "onFriendInfoChanged", errCode: nil, errMsg: nil, data: friendInfo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,219 +5,194 @@ public class GroupManager: BaseServiceManager {
|
|||||||
|
|
||||||
public override func registerHandlers() {
|
public override func registerHandlers() {
|
||||||
super.registerHandlers()
|
super.registerHandlers()
|
||||||
self["setGroupListener"] = setGroupListener
|
self["acceptGroupApplication"] = acceptGroupApplication
|
||||||
self["inviteUserToGroup"] = inviteUserToGroup
|
self["changeGroupMemberMute"] = changeGroupMemberMute
|
||||||
self["kickGroupMember"] = kickGroupMember
|
self["changeGroupMute"] = changeGroupMute
|
||||||
self["getGroupMembersInfo"] = getGroupMembersInfo
|
self["createGroup"] = createGroup
|
||||||
|
self["dismissGroup"] = dismissGroup
|
||||||
|
self["getGroupApplicationListAsApplicant"] = getGroupApplicationListAsApplicant
|
||||||
|
self["getGroupApplicationListAsRecipient"] = getGroupApplicationListAsRecipient
|
||||||
self["getGroupMemberList"] = getGroupMemberList
|
self["getGroupMemberList"] = getGroupMemberList
|
||||||
|
self["getGroupMemberListByJoinTimeFilter"] = getGroupMemberListByJoinTimeFilter
|
||||||
|
self["getGroupMemberOwnerAndAdmin"] = getGroupMemberOwnerAndAdmin
|
||||||
|
self["getGroupMembersInfo"] = getGroupMembersInfo
|
||||||
|
self["getGroupsInfo"] = getGroupsInfo
|
||||||
self["getJoinedGroupList"] = getJoinedGroupList
|
self["getJoinedGroupList"] = getJoinedGroupList
|
||||||
self["getJoinedGroupListPage"] = getJoinedGroupListPage
|
self["getJoinedGroupListPage"] = getJoinedGroupListPage
|
||||||
self["createGroup"] = createGroup
|
|
||||||
self["setGroupInfo"] = setGroupInfo
|
|
||||||
self["getGroupsInfo"] = getGroupsInfo
|
|
||||||
self["joinGroup"] = joinGroup
|
|
||||||
self["quitGroup"] = quitGroup
|
|
||||||
self["transferGroupOwner"] = transferGroupOwner
|
|
||||||
self["getGroupApplicationListAsRecipient"] = getGroupApplicationListAsRecipient
|
|
||||||
self["getGroupApplicationListAsApplicant"] = getGroupApplicationListAsApplicant
|
|
||||||
self["acceptGroupApplication"] = acceptGroupApplication
|
|
||||||
self["refuseGroupApplication"] = refuseGroupApplication
|
|
||||||
self["dismissGroup"] = dismissGroup
|
|
||||||
self["changeGroupMute"] = changeGroupMute
|
|
||||||
self["changeGroupMemberMute"] = changeGroupMemberMute
|
|
||||||
self["setGroupMemberNickname"] = setGroupMemberNickname
|
|
||||||
self["searchGroups"] = searchGroups
|
|
||||||
self["setGroupMemberRoleLevel"] = setGroupMemberRoleLevel
|
|
||||||
self["getGroupMemberListByJoinTimeFilter"] = getGroupMemberListByJoinTimeFilter
|
|
||||||
self["setGroupVerification"] = setGroupVerification
|
|
||||||
self["setGroupLookMemberInfo"] = setGroupLookMemberInfo
|
|
||||||
self["setGroupApplyMemberFriend"] = setGroupApplyMemberFriend
|
|
||||||
self["getGroupMemberOwnerAndAdmin"] = getGroupMemberOwnerAndAdmin
|
|
||||||
self["searchGroupMembers"] = searchGroupMembers
|
|
||||||
self["setGroupMemberInfo"] = setGroupMemberInfo
|
|
||||||
self["isJoinGroup"] = isJoinGroup
|
|
||||||
self["getUsersInGroup"] = getUsersInGroup
|
self["getUsersInGroup"] = getUsersInGroup
|
||||||
|
self["inviteUserToGroup"] = inviteUserToGroup
|
||||||
|
self["isJoinGroup"] = isJoinGroup
|
||||||
|
self["joinGroup"] = joinGroup
|
||||||
|
self["kickGroupMember"] = kickGroupMember
|
||||||
|
self["quitGroup"] = quitGroup
|
||||||
|
self["refuseGroupApplication"] = refuseGroupApplication
|
||||||
|
self["searchGroupMembers"] = searchGroupMembers
|
||||||
|
self["searchGroups"] = searchGroups
|
||||||
|
self["setGroupInfo"] = setGroupInfo
|
||||||
|
self["setGroupListener"] = setGroupListener
|
||||||
|
self["setGroupMemberInfo"] = setGroupMemberInfo
|
||||||
|
self["transferGroupOwner"] = transferGroupOwner
|
||||||
}
|
}
|
||||||
|
|
||||||
func setGroupListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func acceptGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkAcceptGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "userID"], methodCall[string: "handleMsg"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func changeGroupMemberMute(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkChangeGroupMemberMute(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string:"userID"], methodCall[int:"seconds"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func changeGroupMute(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkChangeGroupMute(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[bool: "mute"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func createGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkCreateGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||||
|
}
|
||||||
|
|
||||||
|
func dismissGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkDismissGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getGroupApplicationListAsApplicant(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkGetGroupApplicationListAsApplicant(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getGroupApplicationListAsRecipient(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkGetGroupApplicationListAsRecipient(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getGroupMemberList(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkGetGroupMemberList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[int32: "filter"],
|
||||||
|
methodCall[int32: "offset"], methodCall[int32: "count"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getGroupMemberListByJoinTimeFilter(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkGetGroupMemberListByJoinTimeFilter(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[int32: "offset"], methodCall[int32: "count"], methodCall[int64: "joinTimeBegin"], methodCall[int64: "joinTimeEnd"], methodCall[jsonString: "excludeUserIDList"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getGroupMemberOwnerAndAdmin(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkGetGroupMemberOwnerAndAdmin(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getGroupMembersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkGetSpecifiedGroupMembersInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[jsonString: "userIDList"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getGroupsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkGetSpecifiedGroupsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "groupIDList"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getJoinedGroupList(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkGetJoinedGroupList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getJoinedGroupListPage(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkGetJoinedGroupListPage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int32: "offset"], methodCall[int32: "count"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func getUsersInGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkGetUsersInGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"],
|
||||||
|
methodCall[jsonString: "userIDs"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func inviteUserToGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkInviteUserToGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "reason"],
|
||||||
|
methodCall[jsonString: "userIDList"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func isJoinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkIsJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func joinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string:
|
||||||
|
"reason"], methodCall[int32: "joinSource"], methodCall[jsonString: "ex"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func kickGroupMember(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkKickGroupMember(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "reason"],
|
||||||
|
methodCall[jsonString: "userIDList"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func quitGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkQuitGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func refuseGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkRefuseGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "userID"], methodCall[string: "handleMsg"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func searchGroupMembers(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkSearchGroupMembers(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func searchGroups(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkSearchGroups(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func setGroupInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkSetGroupInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "groupInfo"])
|
||||||
|
}
|
||||||
|
|
||||||
|
func setGroupListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
Open_im_sdkSetGroupListener(GroupListener(channel: channel))
|
Open_im_sdkSetGroupListener(GroupListener(channel: channel))
|
||||||
callBack(result)
|
callBack(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
func inviteUserToGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func setGroupMemberInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
Open_im_sdkInviteUserToGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "reason"],
|
|
||||||
methodCall[jsonString: "userIDList"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func kickGroupMember(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkKickGroupMember(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "reason"],
|
|
||||||
methodCall[jsonString: "userIDList"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func getGroupMembersInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkGetSpecifiedGroupMembersInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[jsonString: "userIDList"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func getGroupMemberList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkGetGroupMemberList(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[int32: "filter"],
|
|
||||||
methodCall[int32: "offset"], methodCall[int32: "count"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func getJoinedGroupList(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkGetJoinedGroupList(BaseCallback(result: result), methodCall[string: "operationID"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func getJoinedGroupListPage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkGetJoinedGroupListPage(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int32: "offset"], methodCall[int32: "count"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func createGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkCreateGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
|
||||||
}
|
|
||||||
|
|
||||||
func setGroupInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkSetGroupInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "groupInfo"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func getGroupsInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkGetSpecifiedGroupsInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "groupIDList"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func joinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string:
|
|
||||||
"reason"], methodCall[int32: "joinSource"], methodCall[jsonString: "ex"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func quitGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkQuitGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func transferGroupOwner(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkTransferGroupOwner(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "userID"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func getGroupApplicationListAsRecipient(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkGetGroupApplicationListAsRecipient(BaseCallback(result: result), methodCall[string: "operationID"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func getGroupApplicationListAsApplicant(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkGetGroupApplicationListAsApplicant(BaseCallback(result: result), methodCall[string: "operationID"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func acceptGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkAcceptGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "userID"], methodCall[string: "handleMsg"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func refuseGroupApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkRefuseGroupApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "userID"], methodCall[string: "handleMsg"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func dismissGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkDismissGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func changeGroupMute(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkChangeGroupMute(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[bool: "mute"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func changeGroupMemberMute(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkChangeGroupMemberMute(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string:"userID"],methodCall[int:"seconds"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func setGroupMemberNickname(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkSetGroupMemberNickname(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string:"userID"],methodCall[string:"groupNickname"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func searchGroups(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkSearchGroups(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func setGroupMemberRoleLevel(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkSetGroupMemberRoleLevel(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string:"userID"],methodCall[int:"roleLevel"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func getGroupMemberListByJoinTimeFilter(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkGetGroupMemberListByJoinTimeFilter(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[int32: "offset"], methodCall[int32: "count"], methodCall[int64: "joinTimeBegin"], methodCall[int64: "joinTimeEnd"], methodCall[jsonString: "excludeUserIDList"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func setGroupVerification(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkSetGroupVerification(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[int32:"needVerification"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func setGroupLookMemberInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkSetGroupLookMemberInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[int32:"status"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func setGroupApplyMemberFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkSetGroupApplyMemberFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[int32:"status"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func getGroupMemberOwnerAndAdmin(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkGetGroupMemberOwnerAndAdmin(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func searchGroupMembers(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkSearchGroupMembers(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func setGroupMemberInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkSetGroupMemberInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "info"])
|
Open_im_sdkSetGroupMemberInfo(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "info"])
|
||||||
}
|
}
|
||||||
|
|
||||||
func isJoinGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkIsJoinGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"])
|
|
||||||
}
|
|
||||||
|
|
||||||
func getUsersInGroup(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func transferGroupOwner(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
Open_im_sdkGetUsersInGroup(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"],
|
Open_im_sdkTransferGroupOwner(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "userID"])
|
||||||
methodCall[jsonString: "userIDs"])
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol {
|
public class GroupListener: NSObject, Open_im_sdk_callbackOnGroupListenerProtocol {
|
||||||
|
|
||||||
private let channel:FlutterMethodChannel
|
private let channel: FlutterMethodChannel
|
||||||
|
|
||||||
init(channel:FlutterMethodChannel) {
|
init(channel: FlutterMethodChannel) {
|
||||||
self.channel = channel
|
self.channel = channel
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onGroupApplicationAccepted(_ s: String?) {
|
public func onGroupApplicationAccepted(_ s: String?) {
|
||||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationAccepted", errCode: nil, errMsg: nil, data: s)
|
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationAccepted", errCode: nil, errMsg: nil, data: s)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onGroupApplicationAdded(_ s: String?) {
|
public func onGroupApplicationAdded(_ s: String?) {
|
||||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationAdded", errCode: nil, errMsg: nil, data: s)
|
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationAdded", errCode: nil, errMsg: nil, data: s)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onGroupApplicationDeleted(_ s: String?) {
|
public func onGroupApplicationDeleted(_ s: String?) {
|
||||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationDeleted", errCode: nil, errMsg: nil, data: s)
|
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationDeleted", errCode: nil, errMsg: nil, data: s)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onGroupApplicationRejected(_ s: String?) {
|
public func onGroupApplicationRejected(_ s: String?) {
|
||||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationRejected", errCode: nil, errMsg: nil, data: s)
|
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationRejected", errCode: nil, errMsg: nil, data: s)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onGroupDismissed(_ s: String?) {
|
public func onGroupDismissed(_ s: String?) {
|
||||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupDismissed", errCode: nil, errMsg: nil, data: s)
|
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupDismissed", errCode: nil, errMsg: nil, data: s)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onGroupInfoChanged(_ s: String?) {
|
public func onGroupInfoChanged(_ s: String?) {
|
||||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupInfoChanged", errCode: nil, errMsg: nil, data: s)
|
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupInfoChanged", errCode: nil, errMsg: nil, data: s)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onGroupMemberAdded(_ s: String?) {
|
public func onGroupMemberAdded(_ s: String?) {
|
||||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberAdded", errCode: nil, errMsg: nil, data: s)
|
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberAdded", errCode: nil, errMsg: nil, data: s)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onGroupMemberDeleted(_ s: String?) {
|
public func onGroupMemberDeleted(_ s: String?) {
|
||||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberDeleted", errCode: nil, errMsg: nil, data: s)
|
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberDeleted", errCode: nil, errMsg: nil, data: s)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onGroupMemberInfoChanged(_ s: String?) {
|
public func onGroupMemberInfoChanged(_ s: String?) {
|
||||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberInfoChanged", errCode: nil, errMsg: nil, data: s)
|
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberInfoChanged", errCode: nil, errMsg: nil, data: s)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onJoinedGroupAdded(_ s: String?) {
|
public func onJoinedGroupAdded(_ s: String?) {
|
||||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onJoinedGroupAdded", errCode: nil, errMsg: nil, data: s)
|
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onJoinedGroupAdded", errCode: nil, errMsg: nil, data: s)
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ public class IMMananger: BaseServiceManager {
|
|||||||
self["getLoginStatus"] = getLoginStatus
|
self["getLoginStatus"] = getLoginStatus
|
||||||
self["uploadFile"] = uploadFile
|
self["uploadFile"] = uploadFile
|
||||||
self["uploadLogs"] = uploadLogs
|
self["uploadLogs"] = uploadLogs
|
||||||
|
self["logs"] = logs
|
||||||
self["updateFcmToken"] = updateFcmToken
|
self["updateFcmToken"] = updateFcmToken
|
||||||
self["setAppBackgroundStatus"] = setAppBackgroundStatus
|
self["setAppBackgroundStatus"] = setAppBackgroundStatus
|
||||||
self["networkStatusChanged"] = networkStatusChanged
|
self["networkStatusChanged"] = networkStatusChanged
|
||||||
@ -89,6 +90,10 @@ public class IMMananger: BaseServiceManager {
|
|||||||
Open_im_sdkUploadLogs(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "line"], methodCall[string: "ex"],
|
Open_im_sdkUploadLogs(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "line"], methodCall[string: "ex"],
|
||||||
UploadLogsListener(channel: self.channel))
|
UploadLogsListener(channel: self.channel))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func logs(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
|
Open_im_sdkLogs(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "logLevel"], methodCall[string: "file"], methodCall[int: "line"], methodCall[string: "msgs"], methodCall[string: "err"], methodCall[string: "keyAndValue"])
|
||||||
|
}
|
||||||
|
|
||||||
func updateFcmToken(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
func updateFcmToken(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
Open_im_sdkUpdateFcmToken(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "fcmToken"], methodCall[int64:
|
Open_im_sdkUpdateFcmToken(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "fcmToken"], methodCall[int64:
|
||||||
|
@ -227,8 +227,7 @@ public class MessageManager: BaseServiceManager {
|
|||||||
|
|
||||||
func sendMessageNotOss(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func sendMessageNotOss(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel,result: result,methodCall: methodCall)
|
let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel,result: result,methodCall: methodCall)
|
||||||
Open_im_sdkSendMessageNotOss(sendMsgProgressListener, methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[string: "userID"],
|
Open_im_sdkSendMessageNotOss(sendMsgProgressListener, methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[string: "userID"], methodCall[string: "groupID"], methodCall[jsonString: "offlinePushInfo"], methodCall[bool: "isOnlineOnly"])
|
||||||
methodCall[string: "groupID"], methodCall[jsonString: "offlinePushInfo"], methodCall[bool: "isOnlineOnly"])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func createImageMessageByURL(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func createImageMessageByURL(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
@ -312,37 +311,6 @@ public class AdvancedMsgListener: NSObject, Open_im_sdk_callbackOnAdvancedMsgLis
|
|||||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvC2CReadReceipt", errCode: nil, errMsg: nil, data: values)
|
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvC2CReadReceipt", errCode: nil, errMsg: nil, data: values)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onRecvGroupReadReceipt(_ groupMsgReceiptList: String?) {
|
|
||||||
var values: [String: Any] = [:]
|
|
||||||
values["id"] = id
|
|
||||||
values["groupMsgReceiptList"] = groupMsgReceiptList
|
|
||||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvGroupReadReceipt", errCode: nil, errMsg: nil, data: values)
|
|
||||||
}
|
|
||||||
|
|
||||||
public func onRecvMessageExtensionsAdded(_ msgID: String?, reactionExtensionList: String?) {
|
|
||||||
var values: [String: Any] = [:]
|
|
||||||
values["id"] = id
|
|
||||||
values["msgID"] = msgID
|
|
||||||
values["reactionExtensionList"] = reactionExtensionList
|
|
||||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageExtensionsAdded", errCode: nil, errMsg: nil, data: values)
|
|
||||||
}
|
|
||||||
|
|
||||||
public func onRecvMessageExtensionsChanged(_ msgID: String?, reactionExtensionList: String?) {
|
|
||||||
var values: [String: Any] = [:]
|
|
||||||
values["id"] = id
|
|
||||||
values["msgID"] = msgID
|
|
||||||
values["reactionExtensionList"] = reactionExtensionList
|
|
||||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageExtensionsChanged", errCode: nil, errMsg: nil, data: values)
|
|
||||||
}
|
|
||||||
|
|
||||||
public func onRecvMessageExtensionsDeleted(_ msgID: String?, reactionExtensionKeyList: String?) {
|
|
||||||
var values: [String: Any] = [:]
|
|
||||||
values["id"] = id
|
|
||||||
values["msgID"] = msgID
|
|
||||||
values["reactionExtensionKeyList"] = reactionExtensionKeyList
|
|
||||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvMessageExtensionsDeleted", errCode: nil, errMsg: nil, data: values)
|
|
||||||
}
|
|
||||||
|
|
||||||
public func onRecvNewMessage(_ message: String?) {
|
public func onRecvNewMessage(_ message: String?) {
|
||||||
var values: [String: Any] = [:]
|
var values: [String: Any] = [:]
|
||||||
values["id"] = id
|
values["id"] = id
|
||||||
@ -350,20 +318,19 @@ public class AdvancedMsgListener: NSObject, Open_im_sdk_callbackOnAdvancedMsgLis
|
|||||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvNewMessage", errCode: nil, errMsg: nil, data: values)
|
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvNewMessage", errCode: nil, errMsg: nil, data: values)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func onRecvOfflineNewMessage(_ message: String?) {
|
||||||
public func onRecvOfflineNewMessage(_ message: String?) {
|
var values: [String: Any] = [:]
|
||||||
var values: [String: Any] = [:]
|
values["id"] = id
|
||||||
values["id"] = id
|
values["message"] = message
|
||||||
values["message"] = message
|
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvOfflineNewMessage", errCode: nil, errMsg: nil, data: values);
|
||||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvOfflineNewMessage", errCode: nil, errMsg: nil, data: values);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public func onRecvOnlineOnlyMessage(_ message: String?) {
|
public func onRecvOnlineOnlyMessage(_ message: String?) {
|
||||||
var values: [String: Any] = [:]
|
var values: [String: Any] = [:]
|
||||||
values["id"] = id
|
values["id"] = id
|
||||||
values["message"] = message
|
values["message"] = message
|
||||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvOnlineOnlyMessage", errCode: nil, errMsg: nil, data: values);
|
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvOnlineOnlyMessage", errCode: nil, errMsg: nil, data: values);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class CustomBusinessListener: NSObject, Open_im_sdk_callbackOnCustomBusinessListenerProtocol {
|
public class CustomBusinessListener: NSObject, Open_im_sdk_callbackOnCustomBusinessListenerProtocol {
|
||||||
@ -377,4 +344,3 @@ public class CustomBusinessListener: NSObject, Open_im_sdk_callbackOnCustomBusin
|
|||||||
CommonUtil.emitEvent(channel: channel, method: "customBusinessListener", type: "onRecvCustomBusinessMessage", errCode: nil, errMsg: nil, data: s)
|
CommonUtil.emitEvent(channel: channel, method: "customBusinessListener", type: "onRecvCustomBusinessMessage", errCode: nil, errMsg: nil, data: s)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,10 +13,6 @@ public class UserManager: BaseServiceManager {
|
|||||||
self["unsubscribeUsersStatus"] = unsubscribeUsersStatus
|
self["unsubscribeUsersStatus"] = unsubscribeUsersStatus
|
||||||
self["getSubscribeUsersStatus"] = getSubscribeUsersStatus
|
self["getSubscribeUsersStatus"] = getSubscribeUsersStatus
|
||||||
self["getUserStatus"] = getUserStatus
|
self["getUserStatus"] = getUserStatus
|
||||||
self["getUsersInfoWithCache"] = getUsersInfoWithCache
|
|
||||||
/*
|
|
||||||
self["setSelfInfoEx"] = setSelfInfoEx
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func setUserListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func setUserListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
@ -51,44 +47,34 @@ public class UserManager: BaseServiceManager {
|
|||||||
func getUserStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func getUserStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkGetUserStatus(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDs"])
|
Open_im_sdkGetUserStatus(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDs"])
|
||||||
}
|
}
|
||||||
|
|
||||||
func getUsersInfoWithCache(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkGetUsersInfoWithCache(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "userIDs"],
|
|
||||||
methodCall[string: "groupID"])
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
func setSelfInfoEx(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
|
||||||
Open_im_sdkSetSelfInfoEx(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UserListener: NSObject, Open_im_sdk_callbackOnUserListenerProtocol {
|
public class UserListener: NSObject, Open_im_sdk_callbackOnUserListenerProtocol {
|
||||||
public func onUserCommandAdd(_ userCommand: String?) {
|
public func onUserCommandAdd(_ userCommand: String?) {
|
||||||
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserCommandAdd", errCode: nil, errMsg: nil, data: userCommand)
|
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserCommandAdd", errCode: nil, errMsg: nil, data: userCommand)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onUserCommandDelete(_ userCommand: String?) {
|
public func onUserCommandDelete(_ userCommand: String?) {
|
||||||
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserCommandDelete", errCode: nil, errMsg: nil, data: userCommand)
|
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserCommandDelete", errCode: nil, errMsg: nil, data: userCommand)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onUserCommandUpdate(_ userCommand: String?) {
|
public func onUserCommandUpdate(_ userCommand: String?) {
|
||||||
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserCommandUpdate", errCode: nil, errMsg: nil, data: userCommand)
|
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserCommandUpdate", errCode: nil, errMsg: nil, data: userCommand)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private let channel:FlutterMethodChannel
|
private let channel:FlutterMethodChannel
|
||||||
|
|
||||||
init(channel:FlutterMethodChannel) {
|
init(channel:FlutterMethodChannel) {
|
||||||
self.channel = channel
|
self.channel = channel
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onSelfInfoUpdated(_ userInfo: String?) {
|
public func onSelfInfoUpdated(_ userInfo: String?) {
|
||||||
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onSelfInfoUpdated", errCode: nil, errMsg: nil, data: userInfo)
|
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onSelfInfoUpdated", errCode: nil, errMsg: nil, data: userInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func onUserStatusChanged(_ statusInfo: String?) {
|
public func onUserStatusChanged(_ statusInfo: String?) {
|
||||||
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserStatusChanged", errCode: nil, errMsg: nil, data: statusInfo)
|
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserStatusChanged", errCode: nil, errMsg: nil, data: statusInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ A new Flutter project.
|
|||||||
s.dependency 'Flutter'
|
s.dependency 'Flutter'
|
||||||
s.platform = :ios, '11.0'
|
s.platform = :ios, '11.0'
|
||||||
|
|
||||||
s.dependency 'OpenIMSDKCore','3.8.1-rc.0'
|
s.dependency 'OpenIMSDKCore','3.8.1'
|
||||||
s.static_framework = true
|
s.static_framework = true
|
||||||
s.library = 'resolv'
|
s.library = 'resolv'
|
||||||
|
|
||||||
|
BIN
lib/.DS_Store
vendored
BIN
lib/.DS_Store
vendored
Binary file not shown.
@ -5,8 +5,6 @@ class OnAdvancedMsgListener {
|
|||||||
Function(Message msg)? onMsgDeleted;
|
Function(Message msg)? onMsgDeleted;
|
||||||
Function(RevokedInfo info)? onNewRecvMessageRevoked;
|
Function(RevokedInfo info)? onNewRecvMessageRevoked;
|
||||||
Function(List<ReadReceiptInfo> list)? onRecvC2CReadReceipt;
|
Function(List<ReadReceiptInfo> list)? onRecvC2CReadReceipt;
|
||||||
Function(List<ReadReceiptInfo> list)? onRecvGroupReadReceipt;
|
|
||||||
Function(String msgID, List<String> list)? onRecvMessageExtensionsDeleted;
|
|
||||||
Function(Message msg)? onRecvNewMessage;
|
Function(Message msg)? onRecvNewMessage;
|
||||||
Function(Message msg)? onRecvOfflineNewMessage;
|
Function(Message msg)? onRecvOfflineNewMessage;
|
||||||
Function(Message msg)? onRecvOnlineOnlyMessage;
|
Function(Message msg)? onRecvOnlineOnlyMessage;
|
||||||
@ -18,8 +16,6 @@ class OnAdvancedMsgListener {
|
|||||||
this.onMsgDeleted,
|
this.onMsgDeleted,
|
||||||
this.onNewRecvMessageRevoked,
|
this.onNewRecvMessageRevoked,
|
||||||
this.onRecvC2CReadReceipt,
|
this.onRecvC2CReadReceipt,
|
||||||
this.onRecvGroupReadReceipt,
|
|
||||||
this.onRecvMessageExtensionsDeleted,
|
|
||||||
this.onRecvNewMessage,
|
this.onRecvNewMessage,
|
||||||
this.onRecvOfflineNewMessage,
|
this.onRecvOfflineNewMessage,
|
||||||
this.onRecvOnlineOnlyMessage,
|
this.onRecvOnlineOnlyMessage,
|
||||||
@ -39,17 +35,6 @@ class OnAdvancedMsgListener {
|
|||||||
onRecvC2CReadReceipt?.call(list);
|
onRecvC2CReadReceipt?.call(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Group Message Read Receipt
|
|
||||||
void recvGroupReadReceipt(List<ReadReceiptInfo> list) {
|
|
||||||
onRecvGroupReadReceipt?.call(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Received Extended Message Deleted
|
|
||||||
/// [list] TypeKey that was deleted
|
|
||||||
void recvMessageExtensionsDeleted(String msgID, List<String> list) {
|
|
||||||
onRecvMessageExtensionsDeleted?.call(msgID, list);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Received a new message
|
/// Received a new message
|
||||||
void recvNewMessage(Message msg) {
|
void recvNewMessage(Message msg) {
|
||||||
onRecvNewMessage?.call(msg);
|
onRecvNewMessage?.call(msg);
|
||||||
|
@ -8,16 +8,25 @@ class OnUploadLogsListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class OnUploadFileListener {
|
class OnUploadFileListener {
|
||||||
|
OnUploadFileListener({
|
||||||
|
this.onComplete,
|
||||||
|
this.onHashPartComplete,
|
||||||
|
this.onHashPartProgress,
|
||||||
|
this.onOpen,
|
||||||
|
this.onPartSize,
|
||||||
|
this.onUploadID,
|
||||||
|
this.onUploadPartComplete,
|
||||||
|
this.onUploadProgress,
|
||||||
|
});
|
||||||
|
|
||||||
Function(String id, int size, String url, int type)? onComplete;
|
Function(String id, int size, String url, int type)? onComplete;
|
||||||
Function(String id, String partHash, String fileHash)? onHashPartComplete;
|
Function(String id, String partHash, String fileHash)? onHashPartComplete;
|
||||||
Function(String id, int index, int size, String partHash)? onHashPartProgress;
|
Function(String id, int index, int size, String partHash)? onHashPartProgress;
|
||||||
Function(String id, int size)? onOpen;
|
Function(String id, int size)? onOpen;
|
||||||
Function(String id, int partSize, int num)? onPartSize;
|
Function(String id, int partSize, int num)? onPartSize;
|
||||||
Function(String id, int fileSize, int streamSize, int storageSize)?
|
Function(String id, int fileSize, int streamSize, int storageSize)? onUploadProgress;
|
||||||
onUploadProgress;
|
|
||||||
Function(String id, String uploadID)? onUploadID;
|
Function(String id, String uploadID)? onUploadID;
|
||||||
Function(String id, int index, int partSize, String partHash)?
|
Function(String id, int index, int partSize, String partHash)? onUploadPartComplete;
|
||||||
onUploadPartComplete;
|
|
||||||
|
|
||||||
void complete(String id, int size, String url, int type) {
|
void complete(String id, int size, String url, int type) {
|
||||||
onComplete?.call(id, size, url, type);
|
onComplete?.call(id, size, url, type);
|
||||||
@ -39,8 +48,7 @@ class OnUploadFileListener {
|
|||||||
onPartSize?.call(id, partSize, num);
|
onPartSize?.call(id, partSize, num);
|
||||||
}
|
}
|
||||||
|
|
||||||
void uploadProgress(
|
void uploadProgress(String id, int fileSize, int streamSize, int storageSize) {
|
||||||
String id, int fileSize, int streamSize, int storageSize) {
|
|
||||||
onUploadProgress?.call(id, fileSize, streamSize, storageSize);
|
onUploadProgress?.call(id, fileSize, streamSize, storageSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
|
import 'dart:async';
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||||
|
|
||||||
|
import '../models/update_req.dart';
|
||||||
|
|
||||||
class ConversationManager {
|
class ConversationManager {
|
||||||
MethodChannel _channel;
|
MethodChannel _channel;
|
||||||
late OnConversationListener listener;
|
late OnConversationListener listener;
|
||||||
@ -98,14 +101,11 @@ class ConversationManager {
|
|||||||
required String conversationID,
|
required String conversationID,
|
||||||
required bool isPinned,
|
required bool isPinned,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) {
|
||||||
_channel.invokeMethod(
|
final req = ConversationReq(isPinned: isPinned);
|
||||||
'pinConversation',
|
|
||||||
_buildParam({
|
return setConversation(conversationID, req, operationID: operationID);
|
||||||
"conversationID": conversationID,
|
}
|
||||||
"isPinned": isPinned,
|
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
|
||||||
}));
|
|
||||||
|
|
||||||
/// Hide a Conversation
|
/// Hide a Conversation
|
||||||
/// [conversationID] Conversation ID
|
/// [conversationID] Conversation ID
|
||||||
@ -161,22 +161,20 @@ class ConversationManager {
|
|||||||
/// Message Do-Not-Disturb Setting
|
/// Message Do-Not-Disturb Setting
|
||||||
/// [conversationID] Conversation ID
|
/// [conversationID] Conversation ID
|
||||||
/// [status] 0: normal; 1: not receiving messages; 2: receive online messages but not offline messages
|
/// [status] 0: normal; 1: not receiving messages; 2: receive online messages but not offline messages
|
||||||
|
@Deprecated('use [setConversation] instead')
|
||||||
Future<dynamic> setConversationRecvMessageOpt({
|
Future<dynamic> setConversationRecvMessageOpt({
|
||||||
required String conversationID,
|
required String conversationID,
|
||||||
required int status,
|
required int status,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) {
|
||||||
_channel.invokeMethod(
|
final req = ConversationReq(recvMsgOpt: status);
|
||||||
'setConversationRecvMessageOpt',
|
|
||||||
_buildParam({
|
|
||||||
"conversationID": conversationID,
|
|
||||||
"status": status,
|
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
|
||||||
}));
|
|
||||||
|
|
||||||
/// Query Do-Not-Disturb Status
|
return setConversation(conversationID, req, operationID: operationID);
|
||||||
/// [conversationIDList] List of conversation IDs
|
}
|
||||||
/// Returns: [{"conversationId":"single_13922222222","result":0}], result values: 0: normal; 1: not receiving messages; 2: receive online messages but not offline messages
|
|
||||||
|
/// Message Do-Not-Disturb Setting
|
||||||
|
/// [conversationID] Conversation ID
|
||||||
|
/// [status] 0: normal; 1: not receiving messages; 2: receive online messages but not offline messages
|
||||||
Future<List<dynamic>> getConversationRecvMessageOpt({
|
Future<List<dynamic>> getConversationRecvMessageOpt({
|
||||||
required List<String> conversationIDList,
|
required List<String> conversationIDList,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
@ -193,18 +191,16 @@ class ConversationManager {
|
|||||||
/// Self-Destruct Messages
|
/// Self-Destruct Messages
|
||||||
/// [conversationID] Conversation ID
|
/// [conversationID] Conversation ID
|
||||||
/// [isPrivate] true: enable, false: disable
|
/// [isPrivate] true: enable, false: disable
|
||||||
|
@Deprecated('use [setConversation] instead')
|
||||||
Future<dynamic> setConversationPrivateChat({
|
Future<dynamic> setConversationPrivateChat({
|
||||||
required String conversationID,
|
required String conversationID,
|
||||||
required bool isPrivate,
|
required bool isPrivate,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) {
|
||||||
_channel.invokeMethod(
|
final req = ConversationReq(isPrivateChat: isPrivate);
|
||||||
'setConversationPrivateChat',
|
|
||||||
_buildParam({
|
return setConversation(conversationID, req, operationID: operationID);
|
||||||
"conversationID": conversationID,
|
}
|
||||||
"isPrivate": isPrivate,
|
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
|
||||||
}));
|
|
||||||
|
|
||||||
/// Delete a Conversation Locally and from the Server
|
/// Delete a Conversation Locally and from the Server
|
||||||
/// [conversationID] Conversation ID
|
/// [conversationID] Conversation ID
|
||||||
@ -245,16 +241,15 @@ class ConversationManager {
|
|||||||
|
|
||||||
/// Reset Mentioned (Group At) Flags [GroupAtType]
|
/// Reset Mentioned (Group At) Flags [GroupAtType]
|
||||||
/// [conversationID] Conversation ID
|
/// [conversationID] Conversation ID
|
||||||
|
@Deprecated('use [setConversation] instead')
|
||||||
Future<dynamic> resetConversationGroupAtType({
|
Future<dynamic> resetConversationGroupAtType({
|
||||||
required String conversationID,
|
required String conversationID,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) {
|
||||||
_channel.invokeMethod(
|
final req = ConversationReq(groupAtType: 0);
|
||||||
'resetConversationGroupAtType',
|
|
||||||
_buildParam({
|
return setConversation(conversationID, req, operationID: operationID);
|
||||||
"conversationID": conversationID,
|
}
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
|
||||||
}));
|
|
||||||
|
|
||||||
/// Query @ All Flag
|
/// Query @ All Flag
|
||||||
Future<dynamic> getAtAllTag({
|
Future<dynamic> getAtAllTag({
|
||||||
@ -271,32 +266,27 @@ class ConversationManager {
|
|||||||
|
|
||||||
/// Global Do-Not-Disturb
|
/// Global Do-Not-Disturb
|
||||||
/// [status] 0: normal; 1: not receiving messages; 2: receive online messages but not offline messages
|
/// [status] 0: normal; 1: not receiving messages; 2: receive online messages but not offline messages
|
||||||
|
@Deprecated('use [OpenIM.iMManager.userManager.setSelfInfo()] instead')
|
||||||
Future<dynamic> setGlobalRecvMessageOpt({
|
Future<dynamic> setGlobalRecvMessageOpt({
|
||||||
required int status,
|
required int status,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) {
|
||||||
_channel.invokeMethod(
|
throw UnimplementedError('setGlobalRecvMessageOpt');
|
||||||
'setGlobalRecvMessageOpt',
|
}
|
||||||
_buildParam({
|
|
||||||
"status": status,
|
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
|
||||||
}));
|
|
||||||
|
|
||||||
/// Set Self-Destruct Message Duration
|
/// Set Self-Destruct Message Duration
|
||||||
/// [conversationID] Conversation ID
|
/// [conversationID] Conversation ID
|
||||||
/// [burnDuration] Duration in seconds, default: 30s
|
/// [burnDuration] Duration in seconds, default: 30s
|
||||||
|
@Deprecated('use [setConversation] instead')
|
||||||
Future<dynamic> setConversationBurnDuration({
|
Future<dynamic> setConversationBurnDuration({
|
||||||
required String conversationID,
|
required String conversationID,
|
||||||
int burnDuration = 30,
|
int burnDuration = 30,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) {
|
||||||
_channel.invokeMethod(
|
final req = ConversationReq(burnDuration: burnDuration);
|
||||||
'setConversationBurnDuration',
|
|
||||||
_buildParam({
|
return setConversation(conversationID, req, operationID: operationID);
|
||||||
"conversationID": conversationID,
|
}
|
||||||
"burnDuration": burnDuration,
|
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
|
||||||
}));
|
|
||||||
|
|
||||||
/// Mark Messages as Read
|
/// Mark Messages as Read
|
||||||
/// [conversationID] Conversation ID
|
/// [conversationID] Conversation ID
|
||||||
@ -311,36 +301,6 @@ class ConversationManager {
|
|||||||
"operationID": Utils.checkOperationID(operationID),
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
/// Enable Regular Deletion
|
|
||||||
/// [isMsgDestruct] true: enable
|
|
||||||
Future<dynamic> setConversationIsMsgDestruct({
|
|
||||||
required String conversationID,
|
|
||||||
bool isMsgDestruct = true,
|
|
||||||
String? operationID,
|
|
||||||
}) =>
|
|
||||||
_channel.invokeMethod(
|
|
||||||
'setConversationIsMsgDestruct',
|
|
||||||
_buildParam({
|
|
||||||
"conversationID": conversationID,
|
|
||||||
"isMsgDestruct": isMsgDestruct,
|
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
|
||||||
}));
|
|
||||||
|
|
||||||
/// Regularly Delete Chat Records
|
|
||||||
/// [duration] Seconds
|
|
||||||
Future<dynamic> setConversationMsgDestructTime({
|
|
||||||
required String conversationID,
|
|
||||||
int duration = 1 * 24 * 60 * 60,
|
|
||||||
String? operationID,
|
|
||||||
}) =>
|
|
||||||
_channel.invokeMethod(
|
|
||||||
'setConversationMsgDestructTime',
|
|
||||||
_buildParam({
|
|
||||||
"conversationID": conversationID,
|
|
||||||
"duration": duration,
|
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
|
||||||
}));
|
|
||||||
|
|
||||||
/// search Conversations
|
/// search Conversations
|
||||||
Future<List<ConversationInfo>> searchConversations(
|
Future<List<ConversationInfo>> searchConversations(
|
||||||
String name, {
|
String name, {
|
||||||
@ -356,18 +316,15 @@ class ConversationManager {
|
|||||||
.then((value) => Utils.toList(value, (map) => ConversationInfo.fromJson(map)));
|
.then((value) => Utils.toList(value, (map) => ConversationInfo.fromJson(map)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated('use [setConversation] instead')
|
||||||
Future setConversationEx(
|
Future setConversationEx(
|
||||||
String conversationID, {
|
String conversationID, {
|
||||||
String? ex,
|
String? ex,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) {
|
}) {
|
||||||
return _channel.invokeMethod(
|
final req = ConversationReq(ex: ex);
|
||||||
'setConversationEx',
|
|
||||||
_buildParam({
|
return setConversation(conversationID, req, operationID: operationID);
|
||||||
'conversationID': conversationID,
|
|
||||||
'ex': ex,
|
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Custom Sort for Conversation List
|
/// Custom Sort for Conversation List
|
||||||
@ -424,14 +381,34 @@ class ConversationManager {
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
.then((value) {
|
.then((value) {
|
||||||
|
print('getInputStates: $value');
|
||||||
final result = Utils.toListMap(value);
|
final result = Utils.toListMap(value);
|
||||||
return List<int>.from(result);
|
return List<int>.from(result);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map _buildParam(Map param) {
|
Future setConversation(
|
||||||
|
String conversationID,
|
||||||
|
ConversationReq req, {
|
||||||
|
String? operationID,
|
||||||
|
}) {
|
||||||
|
return _channel.invokeMethod(
|
||||||
|
'setConversation',
|
||||||
|
_buildParam(
|
||||||
|
{
|
||||||
|
'conversationID': conversationID,
|
||||||
|
'req': req.toJson(),
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Map _buildParam(Map<String, dynamic> param) {
|
||||||
param["ManagerName"] = "conversationManager";
|
param["ManagerName"] = "conversationManager";
|
||||||
|
param = Utils.cleanMap(param);
|
||||||
log('param: $param');
|
log('param: $param');
|
||||||
|
|
||||||
return param;
|
return param;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||||
|
|
||||||
|
import '../models/update_req.dart';
|
||||||
|
|
||||||
class FriendshipManager {
|
class FriendshipManager {
|
||||||
MethodChannel _channel;
|
MethodChannel _channel;
|
||||||
late OnFriendshipListener listener;
|
late OnFriendshipListener listener;
|
||||||
@ -15,8 +19,9 @@ class FriendshipManager {
|
|||||||
|
|
||||||
/// Query Friend Information
|
/// Query Friend Information
|
||||||
/// [userIDList] List of user IDs
|
/// [userIDList] List of user IDs
|
||||||
Future<List<FullUserInfo>> getFriendsInfo({
|
Future<List<PublicUserInfo>> getFriendsInfo({
|
||||||
required List<String> userIDList,
|
required List<String> userIDList,
|
||||||
|
bool filterBlack = false,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) =>
|
||||||
_channel
|
_channel
|
||||||
@ -24,9 +29,10 @@ class FriendshipManager {
|
|||||||
'getFriendsInfo',
|
'getFriendsInfo',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
"userIDList": userIDList,
|
"userIDList": userIDList,
|
||||||
|
'filterBlack': filterBlack,
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
}))
|
}))
|
||||||
.then((value) => Utils.toList(value, (v) => FullUserInfo.fromJson(v)));
|
.then((value) => Utils.toList(value, (v) => PublicUserInfo.fromJson(v)));
|
||||||
|
|
||||||
/// Send a Friend Request, the other party needs to accept the request to become friends.
|
/// Send a Friend Request, the other party needs to accept the request to become friends.
|
||||||
/// [userID] User ID to be invited
|
/// [userID] User ID to be invited
|
||||||
@ -63,23 +69,35 @@ class FriendshipManager {
|
|||||||
.then((value) => Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v)));
|
.then((value) => Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v)));
|
||||||
|
|
||||||
/// Get Friend List, including friends who have been put into the blacklist
|
/// Get Friend List, including friends who have been put into the blacklist
|
||||||
Future<List<FullUserInfo>> getFriendList({String? operationID}) => _channel
|
Future<List<PublicUserInfo>> getFriendList({
|
||||||
.invokeMethod(
|
String? operationID,
|
||||||
'getFriendList',
|
bool filterBlack = false,
|
||||||
_buildParam({
|
}) =>
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
_channel
|
||||||
}))
|
.invokeMethod(
|
||||||
.then((value) => Utils.toList(value, (v) => FullUserInfo.fromJson(v)));
|
'getFriendList',
|
||||||
|
_buildParam({
|
||||||
|
'filterBlack': filterBlack,
|
||||||
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) => Utils.toList(value, (v) => PublicUserInfo.fromJson(v)));
|
||||||
|
|
||||||
Future<List<FullUserInfo>> getFriendListPage({String? operationID, int offset = 0, int count = 40}) => _channel
|
Future<List<PublicUserInfo>> getFriendListPage({
|
||||||
.invokeMethod(
|
bool filterBlack = false,
|
||||||
'getFriendListPage',
|
int offset = 0,
|
||||||
_buildParam({
|
int count = 40,
|
||||||
'offset': offset,
|
String? operationID,
|
||||||
'count': count,
|
}) =>
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
_channel
|
||||||
}))
|
.invokeMethod(
|
||||||
.then((value) => Utils.toList(value, (v) => FullUserInfo.fromJson(v)));
|
'getFriendListPage',
|
||||||
|
_buildParam({
|
||||||
|
'offset': offset,
|
||||||
|
'count': count,
|
||||||
|
'filterBlack': filterBlack,
|
||||||
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) => Utils.toList(value, (v) => PublicUserInfo.fromJson(v)));
|
||||||
|
|
||||||
/// Get Friend List, including friends who have been put into the blacklist (returns a map)
|
/// Get Friend List, including friends who have been put into the blacklist (returns a map)
|
||||||
Future<List<dynamic>> getFriendListMap({String? operationID}) => _channel
|
Future<List<dynamic>> getFriendListMap({String? operationID}) => _channel
|
||||||
@ -90,31 +108,36 @@ class FriendshipManager {
|
|||||||
}))
|
}))
|
||||||
.then((value) => Utils.toListMap(value));
|
.then((value) => Utils.toListMap(value));
|
||||||
|
|
||||||
Future<List<dynamic>> getFriendListPageMap({String? operationID, int offset = 0, int count = 40}) => _channel
|
Future<List<dynamic>> getFriendListPageMap({
|
||||||
.invokeMethod(
|
bool filterBlack = false,
|
||||||
'getFriendListPage',
|
String? operationID,
|
||||||
_buildParam({
|
int offset = 0,
|
||||||
'offset': offset,
|
int count = 40,
|
||||||
'count': count,
|
}) =>
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
_channel
|
||||||
}))
|
.invokeMethod(
|
||||||
.then((value) => Utils.toListMap(value));
|
'getFriendListPage',
|
||||||
|
_buildParam({
|
||||||
|
'offset': offset,
|
||||||
|
'count': count,
|
||||||
|
'filterBlack': filterBlack,
|
||||||
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) => Utils.toListMap(value));
|
||||||
|
|
||||||
/// Set Friend's Remark
|
/// Set Friend's Remark
|
||||||
/// [userID] Friend's userID
|
/// [userID] Friend's userID
|
||||||
/// [remark] Friend's remark
|
/// [remark] Friend's remark
|
||||||
|
@Deprecated('Use [updateFriends] instead')
|
||||||
Future<dynamic> setFriendRemark({
|
Future<dynamic> setFriendRemark({
|
||||||
required String userID,
|
required String userID,
|
||||||
required String remark,
|
required String remark,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) {
|
||||||
_channel.invokeMethod(
|
final req = UpdateFriendsReq(friendUserIDs: [userID], remark: remark);
|
||||||
'setFriendRemark',
|
|
||||||
_buildParam({
|
return updateFriends(req, operationID: operationID);
|
||||||
'toUserID': userID,
|
}
|
||||||
'remark': remark,
|
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
|
||||||
}));
|
|
||||||
|
|
||||||
/// Add to Blacklist
|
/// Add to Blacklist
|
||||||
/// [userID] Friend's ID to be added to the blacklist
|
/// [userID] Friend's ID to be added to the blacklist
|
||||||
@ -239,22 +262,35 @@ class FriendshipManager {
|
|||||||
}))
|
}))
|
||||||
.then((value) => Utils.toList(value, (map) => SearchFriendsInfo.fromJson(map)));
|
.then((value) => Utils.toList(value, (map) => SearchFriendsInfo.fromJson(map)));
|
||||||
|
|
||||||
Future<String?> setFriendsEx(
|
@Deprecated('Use [updateFriends] instead')
|
||||||
|
Future setFriendsEx(
|
||||||
List<String> friendIDs, {
|
List<String> friendIDs, {
|
||||||
String? ex,
|
String? ex,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) {
|
}) {
|
||||||
return _channel.invokeMethod(
|
final req = UpdateFriendsReq(friendUserIDs: friendIDs, ex: ex);
|
||||||
'setFriendsEx',
|
|
||||||
_buildParam({
|
return updateFriends(req, operationID: operationID);
|
||||||
"friendIDs": friendIDs,
|
|
||||||
"ex": ex,
|
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map _buildParam(Map param) {
|
Future<dynamic> updateFriends(
|
||||||
|
UpdateFriendsReq updateFriendsReq, {
|
||||||
|
String? operationID,
|
||||||
|
}) {
|
||||||
|
return _channel
|
||||||
|
.invokeMethod(
|
||||||
|
'updateFriends',
|
||||||
|
_buildParam({
|
||||||
|
'req': updateFriendsReq.toJson(),
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) => value);
|
||||||
|
}
|
||||||
|
|
||||||
|
static Map _buildParam(Map<String, dynamic> param) {
|
||||||
param["ManagerName"] = "friendshipManager";
|
param["ManagerName"] = "friendshipManager";
|
||||||
|
param = Utils.cleanMap(param);
|
||||||
|
|
||||||
return param;
|
return param;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ import 'dart:developer';
|
|||||||
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||||
|
import 'package:flutter_openim_sdk/src/models/set_group_member_info.dart';
|
||||||
|
|
||||||
class GroupManager {
|
class GroupManager {
|
||||||
MethodChannel _channel;
|
MethodChannel _channel;
|
||||||
@ -18,39 +19,43 @@ class GroupManager {
|
|||||||
/// Invite users to a group, allowing them to join without approval.
|
/// Invite users to a group, allowing them to join without approval.
|
||||||
/// [groupID] Group ID
|
/// [groupID] Group ID
|
||||||
/// [userIDList] List of user IDs
|
/// [userIDList] List of user IDs
|
||||||
Future inviteUserToGroup({
|
Future<List<GroupInviteResult>> inviteUserToGroup({
|
||||||
required String groupID,
|
required String groupID,
|
||||||
required List<String> userIDList,
|
required List<String> userIDList,
|
||||||
String? reason,
|
String? reason,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) =>
|
||||||
_channel.invokeMethod(
|
_channel
|
||||||
'inviteUserToGroup',
|
.invokeMethod(
|
||||||
_buildParam({
|
'inviteUserToGroup',
|
||||||
'groupID': groupID,
|
_buildParam({
|
||||||
'userIDList': userIDList,
|
'groupID': groupID,
|
||||||
'reason': reason,
|
'userIDList': userIDList,
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
'reason': reason,
|
||||||
}));
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) => Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
|
||||||
|
|
||||||
/// Remove group members
|
/// Remove group members
|
||||||
/// [groupID] Group ID
|
/// [groupID] Group ID
|
||||||
/// [userIDList] List of user IDs
|
/// [userIDList] List of user IDs
|
||||||
/// [reason] Reason for removal
|
/// [reason] Reason for removal
|
||||||
Future kickGroupMember({
|
Future<List<GroupInviteResult>> kickGroupMember({
|
||||||
required String groupID,
|
required String groupID,
|
||||||
required List<String> userIDList,
|
required List<String> userIDList,
|
||||||
String? reason,
|
String? reason,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) =>
|
||||||
_channel.invokeMethod(
|
_channel
|
||||||
'kickGroupMember',
|
.invokeMethod(
|
||||||
_buildParam({
|
'kickGroupMember',
|
||||||
'groupID': groupID,
|
_buildParam({
|
||||||
'userIDList': userIDList,
|
'groupID': groupID,
|
||||||
'reason': reason,
|
'userIDList': userIDList,
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
'reason': reason,
|
||||||
}));
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) => Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
|
||||||
|
|
||||||
/// Query group member information
|
/// Query group member information
|
||||||
/// [groupID] Group ID
|
/// [groupID] Group ID
|
||||||
@ -213,15 +218,17 @@ class GroupManager {
|
|||||||
|
|
||||||
/// Apply to join a group, requiring approval from an administrator or the group.
|
/// Apply to join a group, requiring approval from an administrator or the group.
|
||||||
/// [joinSource] 2: Invited, 3: Searched, 4: Using a QR code
|
/// [joinSource] 2: Invited, 3: Searched, 4: Using a QR code
|
||||||
Future<dynamic> joinGroup({required String groupID, String? reason, String? operationID, int joinSource = 3, String? ex}) => _channel.invokeMethod(
|
Future<dynamic> joinGroup(
|
||||||
'joinGroup',
|
{required String groupID, String? reason, String? operationID, int joinSource = 3, String? ex}) =>
|
||||||
_buildParam({
|
_channel.invokeMethod(
|
||||||
'groupID': groupID,
|
'joinGroup',
|
||||||
'reason': reason,
|
_buildParam({
|
||||||
'joinSource': joinSource,
|
'groupID': groupID,
|
||||||
'ex': ex,
|
'reason': reason,
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
'joinSource': joinSource,
|
||||||
}));
|
'ex': ex,
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
/// Exit a group
|
/// Exit a group
|
||||||
Future<dynamic> quitGroup({
|
Future<dynamic> quitGroup({
|
||||||
@ -357,20 +364,17 @@ class GroupManager {
|
|||||||
/// [groupID] Group ID
|
/// [groupID] Group ID
|
||||||
/// [userID] User ID of the group member
|
/// [userID] User ID of the group member
|
||||||
/// [groupNickname] Group nickname
|
/// [groupNickname] Group nickname
|
||||||
|
@Deprecated('Use [setGroupMemberInfo] instead')
|
||||||
Future<dynamic> setGroupMemberNickname({
|
Future<dynamic> setGroupMemberNickname({
|
||||||
required String groupID,
|
required String groupID,
|
||||||
required String userID,
|
required String userID,
|
||||||
String? groupNickname,
|
String? groupNickname,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) {
|
||||||
_channel.invokeMethod(
|
final req = SetGroupMemberInfo(groupID: groupID, userID: userID, nickname: groupNickname);
|
||||||
'setGroupMemberNickname',
|
|
||||||
_buildParam({
|
return setGroupMemberInfo(groupMembersInfo: req, operationID: operationID);
|
||||||
'groupID': groupID,
|
}
|
||||||
'userID': userID,
|
|
||||||
'groupNickname': groupNickname ?? '',
|
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
|
||||||
}));
|
|
||||||
|
|
||||||
/// Query a group
|
/// Query a group
|
||||||
/// [keywordList] Search keywords; currently, only one keyword is supported, and it cannot be empty.
|
/// [keywordList] Search keywords; currently, only one keyword is supported, and it cannot be empty.
|
||||||
@ -399,20 +403,17 @@ class GroupManager {
|
|||||||
/// [groupID] Group ID
|
/// [groupID] Group ID
|
||||||
/// [userID] User ID of the group member
|
/// [userID] User ID of the group member
|
||||||
/// [roleLevel] Role level; see [GroupRoleLevel]
|
/// [roleLevel] Role level; see [GroupRoleLevel]
|
||||||
|
@Deprecated('Use [setGroupMemberInfo] instead')
|
||||||
Future<dynamic> setGroupMemberRoleLevel({
|
Future<dynamic> setGroupMemberRoleLevel({
|
||||||
required String groupID,
|
required String groupID,
|
||||||
required String userID,
|
required String userID,
|
||||||
required int roleLevel,
|
required int roleLevel,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) {
|
||||||
_channel.invokeMethod(
|
final req = SetGroupMemberInfo(groupID: groupID, userID: userID, roleLevel: roleLevel);
|
||||||
'setGroupMemberRoleLevel',
|
|
||||||
_buildParam({
|
return setGroupMemberInfo(groupMembersInfo: req, operationID: operationID);
|
||||||
'groupID': groupID,
|
}
|
||||||
'userID': userID,
|
|
||||||
'roleLevel': roleLevel,
|
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
|
||||||
}));
|
|
||||||
|
|
||||||
/// Get a group member list based on join time
|
/// Get a group member list based on join time
|
||||||
Future<List<GroupMembersInfo>> getGroupMemberListByJoinTime({
|
Future<List<GroupMembersInfo>> getGroupMemberListByJoinTime({
|
||||||
@ -441,50 +442,44 @@ class GroupManager {
|
|||||||
/// Set group verification for joining
|
/// Set group verification for joining
|
||||||
/// [groupID] Group ID
|
/// [groupID] Group ID
|
||||||
/// [needVerification] Verification setting; see [GroupVerification] class
|
/// [needVerification] Verification setting; see [GroupVerification] class
|
||||||
|
@Deprecated('Use [setGroupInfo] instead')
|
||||||
Future<dynamic> setGroupVerification({
|
Future<dynamic> setGroupVerification({
|
||||||
required String groupID,
|
required String groupID,
|
||||||
required int needVerification,
|
required int needVerification,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) {
|
||||||
_channel.invokeMethod(
|
final req = GroupInfo(groupID: groupID, needVerification: needVerification);
|
||||||
'setGroupVerification',
|
|
||||||
_buildParam({
|
|
||||||
'groupID': groupID,
|
|
||||||
'needVerification': needVerification,
|
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
|
||||||
}));
|
|
||||||
|
|
||||||
/// Allow/disallow members to view each other's information through the group
|
return setGroupInfo(req, operationID: operationID);
|
||||||
/// [groupID] Group ID
|
}
|
||||||
/// [status] 0: Disable, 1: Enable
|
|
||||||
Future<dynamic> setGroupLookMemberInfo({
|
|
||||||
required String groupID,
|
|
||||||
required int status,
|
|
||||||
String? operationID,
|
|
||||||
}) =>
|
|
||||||
_channel.invokeMethod(
|
|
||||||
'setGroupLookMemberInfo',
|
|
||||||
_buildParam({
|
|
||||||
'groupID': groupID,
|
|
||||||
'status': status,
|
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
|
||||||
}));
|
|
||||||
|
|
||||||
/// Allow/disallow members to add friends through the group
|
/// Allow/disallow members to add friends through the group
|
||||||
/// [groupID] Group ID
|
/// [groupID] Group ID
|
||||||
/// [status] 0: Disable, 1: Enable
|
/// [status] 0: Disable, 1: Enable
|
||||||
|
@Deprecated('Use [setGroupInfo] instead')
|
||||||
|
Future<dynamic> setGroupLookMemberInfo({
|
||||||
|
required String groupID,
|
||||||
|
required int status,
|
||||||
|
String? operationID,
|
||||||
|
}) {
|
||||||
|
final req = GroupInfo(groupID: groupID, lookMemberInfo: status);
|
||||||
|
|
||||||
|
return setGroupInfo(req, operationID: operationID);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Allow/disallow members to add friends through the group
|
||||||
|
/// [groupID] Group ID
|
||||||
|
/// [status] 0: Disable, 1: Enable
|
||||||
|
@Deprecated('Use [setGroupInfo] instead')
|
||||||
Future<dynamic> setGroupApplyMemberFriend({
|
Future<dynamic> setGroupApplyMemberFriend({
|
||||||
required String groupID,
|
required String groupID,
|
||||||
required int status,
|
required int status,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) {
|
||||||
_channel.invokeMethod(
|
final req = GroupInfo(groupID: groupID, applyMemberFriend: status);
|
||||||
'setGroupApplyMemberFriend',
|
|
||||||
_buildParam({
|
return setGroupInfo(req, operationID: operationID);
|
||||||
'groupID': groupID,
|
}
|
||||||
'status': status,
|
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
|
||||||
}));
|
|
||||||
|
|
||||||
/// Get group owners and administrators
|
/// Get group owners and administrators
|
||||||
/// [groupId] Group ID
|
/// [groupId] Group ID
|
||||||
@ -567,7 +562,7 @@ class GroupManager {
|
|||||||
|
|
||||||
/// Modify the GroupMemberInfo ex field
|
/// Modify the GroupMemberInfo ex field
|
||||||
Future<dynamic> setGroupMemberInfo({
|
Future<dynamic> setGroupMemberInfo({
|
||||||
required GroupMembersInfo groupMembersInfo,
|
required SetGroupMemberInfo groupMembersInfo,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) =>
|
||||||
_channel.invokeMethod(
|
_channel.invokeMethod(
|
||||||
@ -590,9 +585,13 @@ class GroupManager {
|
|||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
static Map _buildParam(Map param) {
|
static Map _buildParam(Map<String, dynamic> param) {
|
||||||
param["ManagerName"] = "groupManager";
|
param["ManagerName"] = "groupManager";
|
||||||
|
param = Utils.cleanMap(param);
|
||||||
log('param: $param');
|
log('param: $param');
|
||||||
|
|
||||||
return param;
|
return param;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import 'dart:convert';
|
||||||
import 'dart:developer';
|
import 'dart:developer';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
|
|
||||||
@ -141,18 +142,6 @@ class IMManager {
|
|||||||
var list = Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
var list = Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
||||||
messageManager.msgListener.recvC2CReadReceipt(list);
|
messageManager.msgListener.recvC2CReadReceipt(list);
|
||||||
break;
|
break;
|
||||||
case 'onRecvGroupReadReceipt':
|
|
||||||
var value = call.arguments['data']['groupMsgReceiptList'];
|
|
||||||
var list = Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
|
||||||
messageManager.msgListener.recvGroupReadReceipt(list);
|
|
||||||
break;
|
|
||||||
case 'onRecvMessageExtensionsDeleted':
|
|
||||||
var msgID = call.arguments['data']['msgID'];
|
|
||||||
var value = call.arguments['data']['reactionExtensionKeyList'];
|
|
||||||
var list = Utils.toList(value, (map) => '$map');
|
|
||||||
messageManager.msgListener.recvMessageExtensionsDeleted(msgID, list);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'onRecvNewMessage':
|
case 'onRecvNewMessage':
|
||||||
var value = call.arguments['data']['message'];
|
var value = call.arguments['data']['message'];
|
||||||
final msg = Utils.toObj(value, (map) => Message.fromJson(map));
|
final msg = Utils.toObj(value, (map) => Message.fromJson(map));
|
||||||
@ -367,10 +356,8 @@ class IMManager {
|
|||||||
OnConnectListener listener, {
|
OnConnectListener listener, {
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) {
|
}) {
|
||||||
this._connectListener = listener;
|
_connectListener = listener;
|
||||||
if (config.logFilePath == null) {
|
config.logFilePath ??= config.dataDir;
|
||||||
config.logFilePath = config.dataDir;
|
|
||||||
}
|
|
||||||
return _channel.invokeMethod(
|
return _channel.invokeMethod(
|
||||||
'initSDK',
|
'initSDK',
|
||||||
_buildParam(
|
_buildParam(
|
||||||
@ -387,7 +374,6 @@ class IMManager {
|
|||||||
/// [apiAddr] SDK API address
|
/// [apiAddr] SDK API address
|
||||||
/// [wsAddr] SDK WebSocket address
|
/// [wsAddr] SDK WebSocket address
|
||||||
/// [dataDir] SDK database storage directory
|
/// [dataDir] SDK database storage directory
|
||||||
/// [objectStorage] Object storage minio
|
|
||||||
/// [logLevel] Log level, 1: no printing
|
/// [logLevel] Log level, 1: no printing
|
||||||
/// [enabledEncryption] true: encryption
|
/// [enabledEncryption] true: encryption
|
||||||
/// [enabledCompression] true: compression
|
/// [enabledCompression] true: compression
|
||||||
@ -398,12 +384,13 @@ class IMManager {
|
|||||||
required String dataDir,
|
required String dataDir,
|
||||||
required OnConnectListener listener,
|
required OnConnectListener listener,
|
||||||
int logLevel = 6,
|
int logLevel = 6,
|
||||||
|
bool isNeedEncryption = false,
|
||||||
bool isCompression = false,
|
bool isCompression = false,
|
||||||
bool isLogStandardOutput = true,
|
bool isLogStandardOutput = true,
|
||||||
String? logFilePath,
|
String? logFilePath,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) {
|
}) {
|
||||||
this._connectListener = listener;
|
_connectListener = listener;
|
||||||
return _channel.invokeMethod(
|
return _channel.invokeMethod(
|
||||||
'initSDK',
|
'initSDK',
|
||||||
_buildParam(
|
_buildParam(
|
||||||
@ -414,8 +401,10 @@ class IMManager {
|
|||||||
"dataDir": dataDir,
|
"dataDir": dataDir,
|
||||||
"logLevel": logLevel,
|
"logLevel": logLevel,
|
||||||
"isCompression": isCompression,
|
"isCompression": isCompression,
|
||||||
|
'isNeedEncryption': isNeedEncryption,
|
||||||
"isLogStandardOutput": isLogStandardOutput,
|
"isLogStandardOutput": isLogStandardOutput,
|
||||||
"logFilePath": logFilePath,
|
"logFilePath": logFilePath,
|
||||||
|
'systemType': 'flutter',
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -535,7 +524,7 @@ class IMManager {
|
|||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
/// 上传日志
|
/// Upload logs
|
||||||
Future uploadLogs({
|
Future uploadLogs({
|
||||||
String? ex,
|
String? ex,
|
||||||
int line = 0,
|
int line = 0,
|
||||||
@ -549,6 +538,27 @@ class IMManager {
|
|||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
Future logs({
|
||||||
|
int logLevel = 5,
|
||||||
|
String? file,
|
||||||
|
int line = 0,
|
||||||
|
String? msgs,
|
||||||
|
String? err,
|
||||||
|
List<dynamic>? keyAndValues,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel.invokeMethod(
|
||||||
|
'logs',
|
||||||
|
_buildParam({
|
||||||
|
'line': line,
|
||||||
|
'logLevel': logLevel,
|
||||||
|
'file': file,
|
||||||
|
'msgs': msgs,
|
||||||
|
'err': err,
|
||||||
|
if (keyAndValues != null) 'keyAndValue': jsonEncode(keyAndValues),
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
|
||||||
void setUploadLogsListener(OnUploadLogsListener listener) {
|
void setUploadLogsListener(OnUploadLogsListener listener) {
|
||||||
_uploadLogsListener = listener;
|
_uploadLogsListener = listener;
|
||||||
}
|
}
|
||||||
@ -569,8 +579,10 @@ class IMManager {
|
|||||||
|
|
||||||
MethodChannel get channel => _channel;
|
MethodChannel get channel => _channel;
|
||||||
|
|
||||||
static Map _buildParam(Map param) {
|
static Map _buildParam(Map<String, dynamic> param) {
|
||||||
param["ManagerName"] = "imManager";
|
param["ManagerName"] = "imManager";
|
||||||
|
param = Utils.cleanMap(param);
|
||||||
|
|
||||||
return param;
|
return param;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -147,18 +147,14 @@ class MessageManager {
|
|||||||
|
|
||||||
/// Typing status update
|
/// Typing status update
|
||||||
/// [msgTip] Custom content
|
/// [msgTip] Custom content
|
||||||
|
@Deprecated('Use [OpenIM.iMManager.conversationManager.changeInputStates(conversationID:focus:)] instead')
|
||||||
Future typingStatusUpdate({
|
Future typingStatusUpdate({
|
||||||
required String userID,
|
required String userID,
|
||||||
String? msgTip,
|
String? msgTip,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) {
|
||||||
_channel.invokeMethod(
|
throw UnimplementedError('typingStatusUpdate');
|
||||||
'typingStatusUpdate',
|
}
|
||||||
_buildParam({
|
|
||||||
"msgTip": msgTip,
|
|
||||||
"userID": userID,
|
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
|
||||||
}));
|
|
||||||
|
|
||||||
/// Create a text message
|
/// Create a text message
|
||||||
Future<Message> createTextMessage({
|
Future<Message> createTextMessage({
|
||||||
@ -551,6 +547,7 @@ class MessageManager {
|
|||||||
/// Mark messages as read
|
/// Mark messages as read
|
||||||
/// [conversationID] Conversation ID
|
/// [conversationID] Conversation ID
|
||||||
/// [messageIDList] List of clientMsgIDs of messages to be marked as read
|
/// [messageIDList] List of clientMsgIDs of messages to be marked as read
|
||||||
|
@Deprecated('Use markConversationMessageAsRead instead')
|
||||||
Future markMessagesAsReadByMsgID({
|
Future markMessagesAsReadByMsgID({
|
||||||
required String conversationID,
|
required String conversationID,
|
||||||
required List<String> messageIDList,
|
required List<String> messageIDList,
|
||||||
@ -791,8 +788,10 @@ class MessageManager {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map _buildParam(Map param) {
|
static Map _buildParam(Map<String, dynamic> param) {
|
||||||
param["ManagerName"] = "messageManager";
|
param["ManagerName"] = "messageManager";
|
||||||
|
param = Utils.cleanMap(param);
|
||||||
|
|
||||||
return param;
|
return param;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ class UserManager {
|
|||||||
|
|
||||||
/// Get user information
|
/// Get user information
|
||||||
/// [userIDList] List of user IDs
|
/// [userIDList] List of user IDs
|
||||||
Future<List<FullUserInfo>> getUsersInfo({
|
Future<List<PublicUserInfo>> getUsersInfo({
|
||||||
required List<String> userIDList,
|
required List<String> userIDList,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) =>
|
||||||
@ -26,7 +26,7 @@ class UserManager {
|
|||||||
'userIDList': userIDList,
|
'userIDList': userIDList,
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
}))
|
}))
|
||||||
.then((value) => Utils.toList(value, (v) => FullUserInfo.fromJson(v)));
|
.then((value) => Utils.toList(value, (v) => PublicUserInfo.fromJson(v)));
|
||||||
|
|
||||||
/// Get information of the currently logged-in user
|
/// Get information of the currently logged-in user
|
||||||
Future<UserInfo> getSelfUserInfo({
|
Future<UserInfo> getSelfUserInfo({
|
||||||
@ -48,17 +48,16 @@ class UserManager {
|
|||||||
Future<String?> setSelfInfo({
|
Future<String?> setSelfInfo({
|
||||||
String? nickname,
|
String? nickname,
|
||||||
String? faceURL,
|
String? faceURL,
|
||||||
int? appManagerLevel,
|
int? globalRecvMsgOpt,
|
||||||
String? ex,
|
String? ex,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) =>
|
||||||
_channel.invokeMethod(
|
_channel.invokeMethod(
|
||||||
'setSelfInfo',
|
'setSelfInfo',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
// 'userID': userID,
|
|
||||||
'nickname': nickname,
|
'nickname': nickname,
|
||||||
'faceURL': faceURL,
|
'faceURL': faceURL,
|
||||||
'appManagerLevel': appManagerLevel,
|
'globalRecvMsgOpt': globalRecvMsgOpt,
|
||||||
'ex': ex,
|
'ex': ex,
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
}));
|
}));
|
||||||
@ -115,37 +114,28 @@ class UserManager {
|
|||||||
.then((value) => Utils.toList(value, (map) => UserStatusInfo.fromJson(map)));
|
.then((value) => Utils.toList(value, (map) => UserStatusInfo.fromJson(map)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<List<FullUserInfo>> getUsersInfoWithCache(
|
@Deprecated('Use [getUsersInfo] instead')
|
||||||
|
Future<List<PublicUserInfo>> getUsersInfoWithCache(
|
||||||
List<String> userIDs, {
|
List<String> userIDs, {
|
||||||
String? groupID,
|
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) {
|
}) {
|
||||||
return _channel
|
return getUsersInfo(userIDList: userIDs, operationID: operationID);
|
||||||
.invokeMethod(
|
|
||||||
'getUsersInfoWithCache',
|
|
||||||
_buildParam({
|
|
||||||
'userIDs': userIDs,
|
|
||||||
'groupID': groupID,
|
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
|
||||||
}))
|
|
||||||
.then((value) => Utils.toList(value, (map) => FullUserInfo.fromJson(map)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/// Global Do Not Disturb
|
||||||
Future<String?> setSelfUserInfoEx(
|
/// [status] 0: Normal; 1: Do not accept messages; 2: Accept online messages but not offline messages;
|
||||||
UserInfo userInfo, {
|
@Deprecated('use [setSelfInfo] instead')
|
||||||
|
Future<dynamic> setGlobalRecvMessageOpt({
|
||||||
|
required int status,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) {
|
}) {
|
||||||
return _channel.invokeMethod(
|
return setSelfInfo(globalRecvMsgOpt: status);
|
||||||
'setSelfUserInfoEx',
|
|
||||||
_buildParam({
|
|
||||||
...userInfo.toJson(),
|
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
|
||||||
}));
|
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
static Map _buildParam(Map param) {
|
static Map _buildParam(Map<String, dynamic> param) {
|
||||||
param["ManagerName"] = "userManager";
|
param["ManagerName"] = "userManager";
|
||||||
|
param = Utils.cleanMap(param);
|
||||||
|
|
||||||
return param;
|
return param;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -115,16 +115,11 @@ class GroupInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Corresponding Conversation Type for Group Type
|
/// Corresponding Conversation Type for Group Type
|
||||||
int get sessionType => groupType == GroupType.general
|
int get sessionType => groupType == GroupType.general ? ConversationType.group : ConversationType.superGroup;
|
||||||
? ConversationType.group
|
|
||||||
: ConversationType.superGroup;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
bool operator ==(Object other) =>
|
bool operator ==(Object other) =>
|
||||||
identical(this, other) ||
|
identical(this, other) || other is GroupInfo && runtimeType == other.runtimeType && groupID == other.groupID;
|
||||||
other is GroupInfo &&
|
|
||||||
runtimeType == other.runtimeType &&
|
|
||||||
groupID == other.groupID;
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
int get hashCode => groupID.hashCode;
|
int get hashCode => groupID.hashCode;
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
class InitConfig {
|
class InitConfig {
|
||||||
|
String systemType;
|
||||||
int platformID;
|
int platformID;
|
||||||
String apiAddr;
|
String apiAddr;
|
||||||
String wsAddr;
|
String wsAddr;
|
||||||
@ -6,6 +7,7 @@ class InitConfig {
|
|||||||
int logLevel;
|
int logLevel;
|
||||||
bool isLogStandardOutput;
|
bool isLogStandardOutput;
|
||||||
String? logFilePath;
|
String? logFilePath;
|
||||||
|
bool enabledCompression;
|
||||||
|
|
||||||
InitConfig({
|
InitConfig({
|
||||||
required this.platformID,
|
required this.platformID,
|
||||||
@ -15,18 +17,21 @@ class InitConfig {
|
|||||||
this.logLevel = 6,
|
this.logLevel = 6,
|
||||||
this.isLogStandardOutput = true,
|
this.isLogStandardOutput = true,
|
||||||
this.logFilePath,
|
this.logFilePath,
|
||||||
|
this.enabledCompression = false,
|
||||||
|
this.systemType = 'flutter',
|
||||||
});
|
});
|
||||||
|
|
||||||
factory InitConfig.fromJson(Map<String, dynamic> json) {
|
factory InitConfig.fromJson(Map<String, dynamic> json) {
|
||||||
return InitConfig(
|
return InitConfig(
|
||||||
platformID: json['platformID'],
|
platformID: json['platformID'],
|
||||||
apiAddr: json['apiAddr'],
|
apiAddr: json['apiAddr'],
|
||||||
wsAddr: json['wsAddr'],
|
wsAddr: json['wsAddr'],
|
||||||
dataDir: json['dataDir'],
|
dataDir: json['dataDir'],
|
||||||
logLevel: json['logLevel'],
|
logLevel: json['logLevel'],
|
||||||
isLogStandardOutput: json['isLogStandardOutput'],
|
isLogStandardOutput: json['isLogStandardOutput'],
|
||||||
logFilePath: json['logFilePath'],
|
logFilePath: json['logFilePath'],
|
||||||
);
|
enabledCompression: json['isCompression'],
|
||||||
|
systemType: json['systemType']);
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toMap() {
|
Map<String, dynamic> toMap() {
|
||||||
@ -38,6 +43,8 @@ class InitConfig {
|
|||||||
'logLevel': logLevel,
|
'logLevel': logLevel,
|
||||||
'isLogStandardOutput': isLogStandardOutput,
|
'isLogStandardOutput': isLogStandardOutput,
|
||||||
'logFilePath': logFilePath,
|
'logFilePath': logFilePath,
|
||||||
|
'isCompression': enabledCompression,
|
||||||
|
'systemType': systemType,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
41
lib/src/models/set_group_member_info.dart
Normal file
41
lib/src/models/set_group_member_info.dart
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
class SetGroupMemberInfo {
|
||||||
|
SetGroupMemberInfo({
|
||||||
|
required this.groupID,
|
||||||
|
required this.userID,
|
||||||
|
this.roleLevel,
|
||||||
|
this.nickname,
|
||||||
|
this.faceURL,
|
||||||
|
this.ex,
|
||||||
|
});
|
||||||
|
|
||||||
|
final String groupID;
|
||||||
|
final String userID;
|
||||||
|
final int? roleLevel;
|
||||||
|
final String? nickname;
|
||||||
|
final String? faceURL;
|
||||||
|
final String? ex;
|
||||||
|
|
||||||
|
SetGroupMemberInfo.fromJson(Map<String, dynamic> json)
|
||||||
|
: groupID = json['groupID'],
|
||||||
|
userID = json['userID'],
|
||||||
|
roleLevel = json['roleLevel'],
|
||||||
|
nickname = json['nickname'],
|
||||||
|
faceURL = json['faceURL'],
|
||||||
|
ex = json['ex'];
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
data['groupID'] = groupID;
|
||||||
|
data['userID'] = userID;
|
||||||
|
data['roleLevel'] = roleLevel;
|
||||||
|
data['nickname'] = nickname;
|
||||||
|
data['faceURL'] = faceURL;
|
||||||
|
data['ex'] = ex;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'SetGroupMemberInfo{groupID: $groupID, userID: $userID, roleLevel: $roleLevel, nickname: $nickname, faceURL: $faceURL, ex: $ex}';
|
||||||
|
}
|
||||||
|
}
|
91
lib/src/models/update_req.dart
Normal file
91
lib/src/models/update_req.dart
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
class UpdateFriendsReq {
|
||||||
|
final String? ownerUserID;
|
||||||
|
final List<String>? friendUserIDs;
|
||||||
|
final bool? isPinned;
|
||||||
|
final String? remark;
|
||||||
|
final String? ex;
|
||||||
|
|
||||||
|
UpdateFriendsReq({
|
||||||
|
this.ownerUserID,
|
||||||
|
this.friendUserIDs,
|
||||||
|
this.isPinned,
|
||||||
|
this.remark,
|
||||||
|
this.ex,
|
||||||
|
});
|
||||||
|
|
||||||
|
UpdateFriendsReq.fromJson(Map<String, dynamic> json)
|
||||||
|
: ownerUserID = json['ownerUserID'],
|
||||||
|
friendUserIDs = json['friendUserIDs'],
|
||||||
|
isPinned = json['isPinned'],
|
||||||
|
remark = json['remark'],
|
||||||
|
ex = json['ex'];
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = <String, dynamic>{};
|
||||||
|
data['ownerUserID'] = ownerUserID;
|
||||||
|
data['friendUserIDs'] = friendUserIDs;
|
||||||
|
data['isPinned'] = isPinned;
|
||||||
|
data['remark'] = remark;
|
||||||
|
data['ex'] = ex;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() {
|
||||||
|
return 'UpdateFriendsReq{ownerUserID: $ownerUserID, friendUserIDs: $friendUserIDs, isPinned: $isPinned, remark: $remark, ex: $ex}';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ConversationReq {
|
||||||
|
final String? userID;
|
||||||
|
final String? groupID;
|
||||||
|
final int? recvMsgOpt;
|
||||||
|
final bool? isPinned;
|
||||||
|
final bool? isPrivateChat;
|
||||||
|
final String? ex;
|
||||||
|
final int? burnDuration;
|
||||||
|
final bool? isMsgDestruct;
|
||||||
|
final int? msgDestructTime;
|
||||||
|
final int? groupAtType;
|
||||||
|
|
||||||
|
ConversationReq({
|
||||||
|
this.userID,
|
||||||
|
this.groupID,
|
||||||
|
this.recvMsgOpt,
|
||||||
|
this.isPinned,
|
||||||
|
this.isPrivateChat,
|
||||||
|
this.ex,
|
||||||
|
this.burnDuration,
|
||||||
|
this.isMsgDestruct,
|
||||||
|
this.msgDestructTime,
|
||||||
|
this.groupAtType,
|
||||||
|
});
|
||||||
|
|
||||||
|
ConversationReq.fromJson(Map<String, dynamic> json)
|
||||||
|
: userID = json['userID'],
|
||||||
|
groupID = json['groupID'],
|
||||||
|
recvMsgOpt = json['recvMsgOpt'],
|
||||||
|
isPinned = json['isPinned'],
|
||||||
|
isPrivateChat = json['isPrivateChat'],
|
||||||
|
ex = json['ex'],
|
||||||
|
burnDuration = json['burnDuration'],
|
||||||
|
isMsgDestruct = json['isMsgDestruct'],
|
||||||
|
msgDestructTime = json['msgDestructTime'],
|
||||||
|
groupAtType = json['groupAtType'];
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = <String, dynamic>{};
|
||||||
|
data['userID'] = userID;
|
||||||
|
data['groupID'] = groupID;
|
||||||
|
data['recvMsgOpt'] = recvMsgOpt;
|
||||||
|
data['isPinned'] = isPinned;
|
||||||
|
data['isPrivateChat'] = isPrivateChat;
|
||||||
|
data['ex'] = ex;
|
||||||
|
data['burnDuration'] = burnDuration;
|
||||||
|
data['isMsgDestruct'] = isMsgDestruct;
|
||||||
|
data['msgDestructTime'] = msgDestructTime;
|
||||||
|
data['groupAtType'] = groupAtType;
|
||||||
|
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
@ -74,48 +74,6 @@ class UserInfo {
|
|||||||
int get hashCode => userID.hashCode;
|
int get hashCode => userID.hashCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
class FullUserInfo {
|
|
||||||
/// User's public information
|
|
||||||
PublicUserInfo? publicInfo;
|
|
||||||
|
|
||||||
/// Information visible only to friends
|
|
||||||
FriendInfo? friendInfo;
|
|
||||||
|
|
||||||
/// Blacklist information
|
|
||||||
BlacklistInfo? blackInfo;
|
|
||||||
|
|
||||||
FullUserInfo.fromJson(Map<String, dynamic> 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
final data = Map<String, dynamic>();
|
|
||||||
data['publicInfo'] = this.publicInfo?.toJson();
|
|
||||||
data['friendInfo'] = this.friendInfo?.toJson();
|
|
||||||
data['blackInfo'] = this.blackInfo?.toJson();
|
|
||||||
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
String get userID {
|
|
||||||
return publicInfo?.userID ?? friendInfo?.userID ?? blackInfo?.userID ?? '';
|
|
||||||
}
|
|
||||||
|
|
||||||
String get nickname {
|
|
||||||
return publicInfo?.nickname ?? friendInfo?.nickname ?? blackInfo?.nickname ?? '';
|
|
||||||
}
|
|
||||||
|
|
||||||
String get faceURL {
|
|
||||||
return publicInfo?.faceURL ?? friendInfo?.faceURL ?? blackInfo?.faceURL ?? '';
|
|
||||||
}
|
|
||||||
|
|
||||||
String get showName {
|
|
||||||
return friendInfo?.nickname ?? nickname;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class PublicUserInfo {
|
class PublicUserInfo {
|
||||||
/// User ID
|
/// User ID
|
||||||
String? userID;
|
String? userID;
|
||||||
|
@ -2,9 +2,9 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||||
|
|
||||||
class OpenIM {
|
class OpenIM {
|
||||||
static const version = '3.8.1-rc.0';
|
static const version = '3.8.1';
|
||||||
|
|
||||||
static const _channel = const MethodChannel('flutter_openim_sdk');
|
static const _channel = MethodChannel('flutter_openim_sdk');
|
||||||
|
|
||||||
static final iMManager = IMManager(_channel);
|
static final iMManager = IMManager(_channel);
|
||||||
|
|
||||||
|
@ -4,13 +4,21 @@ class Utils {
|
|||||||
static List<T> toList<T>(String value, T f(Map<String, dynamic> map)) =>
|
static List<T> toList<T>(String value, T f(Map<String, dynamic> map)) =>
|
||||||
(formatJson(value) as List).map((e) => f(e)).toList();
|
(formatJson(value) as List).map((e) => f(e)).toList();
|
||||||
|
|
||||||
static T toObj<T>(String value, T f(Map<String, dynamic> map)) =>
|
static T toObj<T>(String value, T f(Map<String, dynamic> map)) => f(formatJson(value));
|
||||||
f(formatJson(value));
|
|
||||||
|
|
||||||
static List<dynamic> toListMap(String value) => formatJson(value);
|
static List<dynamic> toListMap(String value) => formatJson(value);
|
||||||
|
|
||||||
static dynamic formatJson(String value) => jsonDecode(value);
|
static dynamic formatJson(String value) => jsonDecode(value);
|
||||||
|
|
||||||
static String checkOperationID(String? obj) =>
|
static String checkOperationID(String? obj) => obj ?? DateTime.now().millisecondsSinceEpoch.toString();
|
||||||
obj ?? DateTime.now().millisecondsSinceEpoch.toString();
|
|
||||||
|
static Map<String, dynamic> cleanMap(Map<String, dynamic> map) {
|
||||||
|
map.removeWhere((key, value) {
|
||||||
|
if (value is Map<String, dynamic>) {
|
||||||
|
cleanMap(value);
|
||||||
|
}
|
||||||
|
return value == null;
|
||||||
|
});
|
||||||
|
return map;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
name: flutter_openim_sdk
|
name: flutter_openim_sdk
|
||||||
description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source.
|
description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source.
|
||||||
version: 3.8.1-rc.0
|
version: 3.8.1
|
||||||
homepage: https://www.openim.io
|
homepage: https://www.openim.io
|
||||||
repository: https://github.com/openimsdk/open-im-sdk-flutter
|
repository: https://github.com/openimsdk/open-im-sdk-flutter
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user