Compare commits
13 Commits
3.5.1-alph
...
3.8.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a446a7b33 | ||
|
|
9f57971ee9 | ||
|
|
29b43d03ac | ||
|
|
cade0091a7 | ||
|
|
d90bb33764 | ||
|
|
8c64af6798 | ||
|
|
c10dabc7e8 | ||
|
|
ff25636516 | ||
|
|
43d3f05d4d | ||
|
|
3b8ec30625 | ||
|
|
44fe1a3210 | ||
|
|
9b11686dac | ||
|
|
1764da125b |
22
CHANGELOG.md
22
CHANGELOG.md
@@ -1,7 +1,27 @@
|
||||
## 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
|
||||
|
||||
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.1-rc.0)
|
||||
|
||||
## 3.8.0
|
||||
|
||||
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.8.0)
|
||||
|
||||
## 3.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
|
||||
|
||||
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.5.1)
|
||||
|
||||
## 3.5.1-alpha.7
|
||||
|
||||
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.5.1-alpha.7)
|
||||
-
|
||||
|
||||
## 3.5.1-alpha.2
|
||||
|
||||
- [Bug fixes and performance enhancements.](https://github.com/openimsdk/openim-sdk-core/releases/tag/v3.5.1-alpha.2)
|
||||
|
||||
@@ -138,7 +138,7 @@ You can find a demo Flutter app that uses the SDK in the [open-im-flutter-demo](
|
||||
|
||||
- 📚 [OpenIM Community](https://github.com/OpenIMSDK/community)
|
||||
- 💕 [OpenIM Interest Group](https://github.com/Openim-sigs)
|
||||
- 🚀 [Join our Slack community](https://join.slack.com/t/openimsdk/shared_invite/zt-22720d66b-o_FvKxMTGXtcnnnHiMqe9Q)
|
||||
- 🚀 [Join our Slack community](https://join.slack.com/t/openimsdk/shared_invite/zt-2ijy1ys1f-O0aEDCr7ExRZ7mwsHAVg9A)
|
||||
- :eyes: [Join our wechat (微信群)](https://openim-1253691595.cos.ap-nanjing.myqcloud.com/WechatIMG20.jpeg)
|
||||
|
||||
## Community Meetings :calendar:
|
||||
|
||||
@@ -52,5 +52,5 @@ android {
|
||||
dependencies {
|
||||
// 本地依赖,现将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:3.5.1-alpha.7@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);
|
||||
}
|
||||
|
||||
@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
|
||||
public void onRecvNewMessage(String s) {
|
||||
final Map<String, String> values = new ArrayMap<>();
|
||||
|
||||
@@ -19,13 +19,15 @@ public class OnBaseListener implements Base {
|
||||
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,4 +31,9 @@ public class OnConnListener implements open_im_sdk_callback.OnConnListener {
|
||||
public void onUserTokenExpired() {
|
||||
CommonUtil.emitEvent("connectListener", "onUserTokenExpired", null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserTokenInvalid(String s) {
|
||||
CommonUtil.emitEvent("connectListener", "onUserTokenInvalid", s);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,18 +21,23 @@ public class OnConversationListener implements open_im_sdk_callback.OnConversati
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSyncServerFailed() {
|
||||
CommonUtil.emitEvent("conversationListener", "onSyncServerFailed", null);
|
||||
public void onSyncServerFailed(boolean reinstalled) {
|
||||
CommonUtil.emitEvent("conversationListener", "onSyncServerFailed", reinstalled);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSyncServerFinish() {
|
||||
CommonUtil.emitEvent("conversationListener", "onSyncServerFinish", null);
|
||||
public void onSyncServerFinish(boolean reinstalled) {
|
||||
CommonUtil.emitEvent("conversationListener", "onSyncServerFinish", reinstalled);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSyncServerStart() {
|
||||
CommonUtil.emitEvent("conversationListener", "onSyncServerStart", null);
|
||||
public void onSyncServerStart(boolean reinstalled) {
|
||||
CommonUtil.emitEvent("conversationListener", "onSyncServerStart", reinstalled);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSyncServerProgress(long progress) {
|
||||
CommonUtil.emitEvent("conversationListener", "onSyncServerProgress", progress);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,66 +24,6 @@
|
||||
// }
|
||||
//
|
||||
// @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) {
|
||||
// CommonUtil.emitEvent("listenerForService", "onRecvNewMessage", s);
|
||||
// }
|
||||
|
||||
@@ -13,4 +13,19 @@ public class OnUserListener implements open_im_sdk_callback.OnUserListener {
|
||||
public void onUserStatusChanged(String s) {
|
||||
CommonUtil.emitEvent("userListener", "onUserStatusChanged", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserCommandAdd(String s) {
|
||||
CommonUtil.emitEvent("userListener", "onUserCommandAdd", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserCommandDelete(String s) {
|
||||
CommonUtil.emitEvent("userListener", "onUserCommandDelete", s);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUserCommandUpdate(String s) {
|
||||
CommonUtil.emitEvent("userListener", "onUserCommandUpdate", 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) {
|
||||
Open_im_sdk.hideConversation(
|
||||
new OnBaseListener(result, methodCall),
|
||||
@@ -98,32 +89,6 @@ public class ConversationManager extends BaseManager {
|
||||
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) {
|
||||
Open_im_sdk.clearConversationAndDeleteAllMsg(
|
||||
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) {
|
||||
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) {
|
||||
Open_im_sdk.hideAllConversations(
|
||||
new OnBaseListener(result, methodCall),
|
||||
@@ -205,12 +124,39 @@ public class ConversationManager extends BaseManager {
|
||||
);
|
||||
}
|
||||
|
||||
public void setConversationEx(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setConversationEx(
|
||||
public void changeInputStates(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.changeInputStates(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
value(methodCall, "ex")
|
||||
value(methodCall, "focus")
|
||||
);
|
||||
}
|
||||
|
||||
public void getInputStates(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getInputStates(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "conversationID"),
|
||||
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(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "userIDList")
|
||||
jsonValue(methodCall, "userIDList"),
|
||||
value(methodCall, "filterBlack")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -48,15 +49,18 @@ public class FriendshipManager extends BaseManager {
|
||||
public void getFriendList(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getFriendList(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID")
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "filterBlack")
|
||||
);
|
||||
}
|
||||
|
||||
public void setFriendRemark(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setFriendRemark(
|
||||
public void getFriendListPage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getFriendListPage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall)
|
||||
value(methodCall, "offset"),
|
||||
value(methodCall, "count"),
|
||||
value(methodCall, "filterBlack")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -124,12 +128,11 @@ public class FriendshipManager extends BaseManager {
|
||||
);
|
||||
}
|
||||
|
||||
public void setFriendsEx(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.setFriendsEx(
|
||||
public void updateFriends(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.updateFriends(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
jsonValue(methodCall, "friendIDs"),
|
||||
value(methodCall, "ex")
|
||||
jsonValue(methodCall, "req")
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,6 +62,15 @@ public class GroupManager extends BaseManager {
|
||||
);
|
||||
}
|
||||
|
||||
public void getJoinedGroupListPage(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getJoinedGroupListPage(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "offset"),
|
||||
value(methodCall, "count")
|
||||
);
|
||||
}
|
||||
|
||||
public void createGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.createGroup(
|
||||
new OnBaseListener(result, methodCall),
|
||||
@@ -177,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) {
|
||||
Open_im_sdk.searchGroups(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
@@ -193,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) {
|
||||
Open_im_sdk.getGroupMemberListByJoinTimeFilter(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
@@ -214,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) {
|
||||
Open_im_sdk.getGroupMemberOwnerAndAdmin(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
@@ -265,4 +232,12 @@ public class GroupManager extends BaseManager {
|
||||
value(methodCall, "groupID")
|
||||
);
|
||||
}
|
||||
|
||||
public void getUsersInGroup(MethodCall methodCall, MethodChannel.Result result) {
|
||||
Open_im_sdk.getUsersInGroup(new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
value(methodCall, "groupID"),
|
||||
jsonValue(methodCall, "userIDs")
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -67,11 +67,25 @@ public class IMManager extends BaseManager {
|
||||
Open_im_sdk.uploadLogs(
|
||||
new OnBaseListener(result, methodCall),
|
||||
value(methodCall, "operationID"),
|
||||
int2long(methodCall, "line"),
|
||||
value(methodCall, "ex"),
|
||||
new OnUploadLogsListener(result, methodCall)
|
||||
);
|
||||
}
|
||||
|
||||
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) {
|
||||
Open_im_sdk.setAppBackgroundStatus(
|
||||
new OnBaseListener(result, methodCall),
|
||||
|
||||
@@ -27,7 +27,8 @@ public class MessageManager extends BaseManager {
|
||||
jsonValue(methodCall, "message"),
|
||||
value(methodCall, "userID"),
|
||||
value(methodCall, "groupID"),
|
||||
jsonValue(methodCall, "offlinePushInfo")
|
||||
jsonValue(methodCall, "offlinePushInfo"),
|
||||
value(methodCall, "isOnlineOnly")
|
||||
);
|
||||
}
|
||||
|
||||
@@ -338,7 +339,8 @@ public class MessageManager extends BaseManager {
|
||||
jsonValue(methodCall, "message"),
|
||||
value(methodCall, "userID"),
|
||||
value(methodCall, "groupID"),
|
||||
jsonValue(methodCall, "offlinePushInfo")
|
||||
jsonValue(methodCall, "offlinePushInfo"),
|
||||
value(methodCall, "isOnlineOnly")
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -61,20 +61,4 @@ public class UserManager extends BaseManager {
|
||||
value(methodCall, "operationID"),
|
||||
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) {
|
||||
String threadName = Thread.currentThread().getName();
|
||||
runMainThread(() -> {
|
||||
Map<String, Object> res = new ArrayMap<>();
|
||||
if (null != type) {
|
||||
@@ -47,7 +48,7 @@ public class CommonUtil {
|
||||
if (null != 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);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
buildscript {
|
||||
repositories {
|
||||
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
|
||||
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
||||
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
|
||||
maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
|
||||
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
|
||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }
|
||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
@@ -15,10 +15,10 @@ buildscript {
|
||||
|
||||
allprojects {
|
||||
repositories {
|
||||
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
|
||||
maven { url 'http://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
||||
maven { url 'http://maven.aliyun.com/nexus/content/repositories/google' }
|
||||
maven { url 'http://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
|
||||
maven { url 'https://maven.aliyun.com/nexus/content/groups/public/' }
|
||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/jcenter' }
|
||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/google' }
|
||||
maven { url 'https://maven.aliyun.com/nexus/content/repositories/gradle-plugin' }
|
||||
google()
|
||||
mavenCentral()
|
||||
}
|
||||
|
||||
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-all.zip
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# Uncomment this line to define a global platform for your project
|
||||
platform :ios, '11.0'
|
||||
|
||||
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
|
||||
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
|
||||
|
||||
@@ -2,8 +2,8 @@ PODS:
|
||||
- Flutter (1.0.0)
|
||||
- flutter_openim_sdk (0.0.1):
|
||||
- Flutter
|
||||
- OpenIMSDKCore (= 3.4.0)
|
||||
- OpenIMSDKCore (3.4.0)
|
||||
- OpenIMSDKCore (= 3.8.1-rc.0)
|
||||
- OpenIMSDKCore (3.8.1-rc.0)
|
||||
|
||||
DEPENDENCIES:
|
||||
- Flutter (from `Flutter`)
|
||||
@@ -20,10 +20,10 @@ EXTERNAL SOURCES:
|
||||
:path: ".symlinks/plugins/flutter_openim_sdk/ios"
|
||||
|
||||
SPEC CHECKSUMS:
|
||||
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
|
||||
flutter_openim_sdk: 54d1c836ff60ebb5b99d246521ef0cb1d834fb13
|
||||
OpenIMSDKCore: 47e0e830afe0d2dd905ad3dda255e6a6d26a555c
|
||||
Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7
|
||||
flutter_openim_sdk: 754e4ad0177918ce2c37dfba63973db26ce89c90
|
||||
OpenIMSDKCore: 0c92e9e3eb2a91b6b6528e7781a1e28ed42bc518
|
||||
|
||||
PODFILE CHECKSUM: 7368163408c647b7eb699d0d788ba6718e18fb8d
|
||||
PODFILE CHECKSUM: d4ba08011ff3d270b662299a448a7c436eb30089
|
||||
|
||||
COCOAPODS: 1.13.0
|
||||
COCOAPODS: 1.14.3
|
||||
|
||||
@@ -341,14 +341,14 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = BDLHL8GNFV;
|
||||
DEVELOPMENT_TEAM = V57RT7LMFH;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = cn.rentsoft.uni;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.openim.sdk.example;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
@@ -473,14 +473,14 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = BDLHL8GNFV;
|
||||
DEVELOPMENT_TEAM = V57RT7LMFH;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = cn.rentsoft.uni;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.openim.sdk.example;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
|
||||
@@ -497,14 +497,14 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CLANG_ENABLE_MODULES = YES;
|
||||
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
|
||||
DEVELOPMENT_TEAM = BDLHL8GNFV;
|
||||
DEVELOPMENT_TEAM = V57RT7LMFH;
|
||||
ENABLE_BITCODE = NO;
|
||||
INFOPLIST_FILE = Runner/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
);
|
||||
PRODUCT_BUNDLE_IDENTIFIER = cn.rentsoft.uni;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = io.openim.sdk.example;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h";
|
||||
SWIFT_VERSION = 5.0;
|
||||
|
||||
@@ -19,7 +19,6 @@ class _MyAppState extends State<MyApp> {
|
||||
apiAddr: '',
|
||||
wsAddr: '',
|
||||
dataDir: '/',
|
||||
objectStorage: 'minio',
|
||||
listener: OnConnectListener());
|
||||
}
|
||||
|
||||
|
||||
@@ -68,44 +68,68 @@ packages:
|
||||
path: ".."
|
||||
relative: true
|
||||
source: path
|
||||
version: "3.5.0-rc.1+1"
|
||||
version: "3.8.1"
|
||||
flutter_test:
|
||||
dependency: "direct dev"
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
leak_tracker:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker
|
||||
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.0.4"
|
||||
leak_tracker_flutter_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_flutter_testing
|
||||
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.3"
|
||||
leak_tracker_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_testing
|
||||
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
|
||||
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.12.16"
|
||||
version: "0.12.16+1"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
|
||||
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.5.0"
|
||||
version: "0.8.0"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
|
||||
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.10.0"
|
||||
version: "1.12.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
|
||||
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.8.3"
|
||||
version: "1.9.0"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@@ -155,10 +179,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
|
||||
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.1"
|
||||
version: "0.7.0"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -167,14 +191,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
web:
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: web
|
||||
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
|
||||
name: vm_service
|
||||
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.0"
|
||||
version: "14.2.1"
|
||||
sdks:
|
||||
dart: ">=3.2.0-194.0.dev <4.0.0"
|
||||
flutter: ">=1.20.0"
|
||||
dart: ">=3.3.0 <4.0.0"
|
||||
flutter: ">=3.18.0-18.0.pre.54"
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
import 'package:flutter_openim_sdk_example/main.dart';
|
||||
import '../lib/main.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('Verify Platform version', (WidgetTester tester) async {
|
||||
@@ -18,8 +18,7 @@ void main() {
|
||||
// Verify that platform version is retrieved.
|
||||
expect(
|
||||
find.byWidgetPredicate(
|
||||
(Widget widget) => widget is Text &&
|
||||
widget.data!.startsWith('Running on:'),
|
||||
(Widget widget) => widget is Text && widget.data!.startsWith('Running on:'),
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
|
||||
@@ -2,169 +2,146 @@ import Foundation
|
||||
import OpenIMCore
|
||||
|
||||
public class ConversationManager: BaseServiceManager {
|
||||
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
self["setConversationListener"] = setConversationListener
|
||||
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["changeInputStates"] = changeInputStates
|
||||
self["clearConversationAndDeleteAllMsg"] = clearConversationAndDeleteAllMsg
|
||||
self["deleteConversationAndDeleteAllMsg"] = deleteConversationAndDeleteAllMsg
|
||||
self["deleteAllConversationFromLocal"] = deleteAllConversationFromLocal
|
||||
self["resetConversationGroupAtType"] = resetConversationGroupAtType
|
||||
self["getAllConversationList"] = getAllConversationList
|
||||
self["getAtAllTag"] = getAtAllTag
|
||||
self["setGlobalRecvMessageOpt"] = setGlobalRecvMessageOpt
|
||||
self["setConversationBurnDuration"] = setConversationBurnDuration
|
||||
self["getConversationIDBySessionType"] = getConversationIDBySessionType
|
||||
self["getConversationListSplit"] = getConversationListSplit
|
||||
self["getInputStates"] = getInputStates
|
||||
self["getMultipleConversation"] = getMultipleConversation
|
||||
self["getOneConversation"] = getOneConversation
|
||||
self["getTotalUnreadMsgCount"] = getTotalUnreadMsgCount
|
||||
self["hideAllConversations"] = hideAllConversations
|
||||
self["hideConversation"] = hideConversation
|
||||
self["markConversationMessageAsRead"] = markConversationMessageAsRead
|
||||
self["searchConversation"] = searchConversation
|
||||
self["setConversationEx"] = setConversationEx
|
||||
self["setConversationDraft"] = setConversationDraft
|
||||
self["setConversationListener"] = setConversationListener
|
||||
self["setConversation"] = setConversation
|
||||
self["searchConversations"] = searchConversations
|
||||
}
|
||||
|
||||
func setConversationListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetConversationListener(ConversationListener(channel: channel))
|
||||
callBack(result)
|
||||
|
||||
func changeInputStates(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkChangeInputStates(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[bool: "focus"])
|
||||
}
|
||||
|
||||
func getAllConversationList(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 getConversationListSplit(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetConversationListSplit(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "offset"], methodCall[int: "count"])
|
||||
func getAtAllTag(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
callBack(result, Open_im_sdkGetAtAllTag(methodCall[string: "operationID"]))
|
||||
}
|
||||
|
||||
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"])
|
||||
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 getConversationListSplit(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetConversationListSplit(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "offset"], methodCall[int: "count"])
|
||||
}
|
||||
|
||||
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 getInputStates(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetInputStates(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[string: "userID"])
|
||||
}
|
||||
|
||||
func hideAllConversations(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkHideAllConversations(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
func getMultipleConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkGetMultipleConversation(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationIDList"])
|
||||
}
|
||||
|
||||
func searchConversation(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
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 setConversationEx(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetConversationEx(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[jsonString: "ex"])
|
||||
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 {
|
||||
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
init(channel:FlutterMethodChannel) {
|
||||
|
||||
private let channel: FlutterMethodChannel
|
||||
|
||||
init(channel: FlutterMethodChannel) {
|
||||
self.channel = channel
|
||||
}
|
||||
|
||||
|
||||
public func onConversationChanged(_ conversationList: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onConversationChanged", errCode: nil, errMsg: nil, data: conversationList)
|
||||
}
|
||||
|
||||
public func onNewConversation(_ conversationList: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onNewConversation", errCode: nil, errMsg: nil, data: conversationList)
|
||||
}
|
||||
|
||||
public func onSyncServerFailed() {
|
||||
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerFailed", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
|
||||
public func onSyncServerFinish() {
|
||||
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerFinish", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
|
||||
public func onSyncServerStart() {
|
||||
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onSyncServerStart", errCode: nil, errMsg: nil, data: nil)
|
||||
}
|
||||
|
||||
public func onTotalUnreadMessageCountChanged(_ totalUnreadCount: Int32) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "conversationListener", type: "onTotalUnreadMessageCountChanged", errCode: nil, errMsg: nil, data: totalUnreadCount)
|
||||
}
|
||||
|
||||
public func onConversationUserInputStatusChanged(_ change: String?) {
|
||||
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,63 +5,34 @@ public class FriendshipManager: BaseServiceManager {
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
self["setFriendListener"] = setFriendListener
|
||||
self["getFriendsInfo"] = getFriendsInfo
|
||||
self["addFriend"] = addFriend
|
||||
self["getFriendApplicationListAsRecipient"] = getFriendApplicationListAsRecipient
|
||||
self["getFriendApplicationListAsApplicant"] = getFriendApplicationListAsApplicant
|
||||
self["getFriendList"] = getFriendList
|
||||
self["setFriendRemark"] = setFriendRemark
|
||||
self["acceptFriendApplication"] = acceptFriendApplication
|
||||
self["addBlacklist"] = addBlacklist
|
||||
self["getBlacklist"] = getBlacklist
|
||||
self["removeBlacklist"] = removeBlacklist
|
||||
self["addFriend"] = addFriend
|
||||
self["checkFriend"] = checkFriend
|
||||
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["removeBlacklist"] = removeBlacklist
|
||||
self["searchFriends"] = searchFriends
|
||||
self["setFriendsEx"] = setFriendsEx
|
||||
self["setFriendListener"] = setFriendListener
|
||||
self["updateFriends"] = updateFriends
|
||||
}
|
||||
|
||||
func setFriendListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetFriendListener(FriendshipListener(channel: channel))
|
||||
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 acceptFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAcceptFriendApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
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 setFriendRemark(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetFriendRemark(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func addBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAddBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[string: "ex"])
|
||||
}
|
||||
|
||||
func getBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkGetBlackList(BaseCallback(result: result), methodCall[string: "operationID"])
|
||||
}
|
||||
|
||||
func removeBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkRemoveBlack(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
||||
func addFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAddFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
}
|
||||
|
||||
func checkFriend(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -72,20 +43,49 @@ public class FriendshipManager: BaseServiceManager {
|
||||
Open_im_sdkDeleteFriend(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"])
|
||||
}
|
||||
|
||||
func acceptFriendApplication(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkAcceptFriendApplication(BaseCallback(result: result), methodCall[string: "operationID"], methodCall.toJsonString())
|
||||
func getBlacklist(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
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){
|
||||
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){
|
||||
Open_im_sdkSearchFriends(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "searchParam"])
|
||||
}
|
||||
|
||||
func setFriendsEx(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
Open_im_sdkSetFriendsEx(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "friendIDs"], methodCall[string: "ex"])
|
||||
|
||||
func setFriendListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
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"])
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,208 +5,194 @@ public class GroupManager: BaseServiceManager {
|
||||
|
||||
public override func registerHandlers() {
|
||||
super.registerHandlers()
|
||||
self["setGroupListener"] = setGroupListener
|
||||
self["inviteUserToGroup"] = inviteUserToGroup
|
||||
self["kickGroupMember"] = kickGroupMember
|
||||
self["getGroupMembersInfo"] = getGroupMembersInfo
|
||||
self["getGroupMemberList"] = getGroupMemberList
|
||||
self["getJoinedGroupList"] = getJoinedGroupList
|
||||
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["changeGroupMute"] = changeGroupMute
|
||||
self["createGroup"] = createGroup
|
||||
self["dismissGroup"] = dismissGroup
|
||||
self["getGroupApplicationListAsApplicant"] = getGroupApplicationListAsApplicant
|
||||
self["getGroupApplicationListAsRecipient"] = getGroupApplicationListAsRecipient
|
||||
self["getGroupMemberList"] = getGroupMemberList
|
||||
self["getGroupMemberListByJoinTimeFilter"] = getGroupMemberListByJoinTimeFilter
|
||||
self["setGroupVerification"] = setGroupVerification
|
||||
self["setGroupLookMemberInfo"] = setGroupLookMemberInfo
|
||||
self["setGroupApplyMemberFriend"] = setGroupApplyMemberFriend
|
||||
self["getGroupMemberOwnerAndAdmin"] = getGroupMemberOwnerAndAdmin
|
||||
self["searchGroupMembers"] = searchGroupMembers
|
||||
self["setGroupMemberInfo"] = setGroupMemberInfo
|
||||
self["getGroupMembersInfo"] = getGroupMembersInfo
|
||||
self["getGroupsInfo"] = getGroupsInfo
|
||||
self["getJoinedGroupList"] = getJoinedGroupList
|
||||
self["getJoinedGroupListPage"] = getJoinedGroupListPage
|
||||
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))
|
||||
callBack(result)
|
||||
}
|
||||
|
||||
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 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 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){
|
||||
func setGroupMemberInfo(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
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 transferGroupOwner(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkTransferGroupOwner(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "groupID"], methodCall[string: "userID"])
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
public func onGroupApplicationAccepted(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationAccepted", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
|
||||
public func onGroupApplicationAdded(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationAdded", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
|
||||
public func onGroupApplicationDeleted(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationDeleted", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
|
||||
public func onGroupApplicationRejected(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupApplicationRejected", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
|
||||
public func onGroupDismissed(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupDismissed", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
|
||||
public func onGroupInfoChanged(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupInfoChanged", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
|
||||
public func onGroupMemberAdded(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberAdded", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
|
||||
public func onGroupMemberDeleted(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberDeleted", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
|
||||
public func onGroupMemberInfoChanged(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onGroupMemberInfoChanged", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
|
||||
public func onJoinedGroupAdded(_ s: String?) {
|
||||
CommonUtil.emitEvent(channel: channel, method: "groupListener", type: "onJoinedGroupAdded", errCode: nil, errMsg: nil, data: s)
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ public class IMMananger: BaseServiceManager {
|
||||
self["getLoginStatus"] = getLoginStatus
|
||||
self["uploadFile"] = uploadFile
|
||||
self["uploadLogs"] = uploadLogs
|
||||
self["logs"] = logs
|
||||
self["updateFcmToken"] = updateFcmToken
|
||||
self["setAppBackgroundStatus"] = setAppBackgroundStatus
|
||||
self["networkStatusChanged"] = networkStatusChanged
|
||||
@@ -86,8 +87,12 @@ public class IMMananger: BaseServiceManager {
|
||||
}
|
||||
|
||||
func uploadLogs(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||
Open_im_sdkUploadLogs(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "ex"], UploadLogsListener(channel: self
|
||||
.channel))
|
||||
Open_im_sdkUploadLogs(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int: "line"], methodCall[string: "ex"],
|
||||
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) {
|
||||
@@ -105,6 +110,10 @@ public class IMMananger: BaseServiceManager {
|
||||
}
|
||||
|
||||
public class ConnListener: NSObject, Open_im_sdk_callbackOnConnListenerProtocol {
|
||||
public func onUserTokenInvalid(_ errMsg: String?) {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "connectListener", type: "onUserTokenInvalid", errCode: nil, errMsg: errMsg, data: nil)
|
||||
}
|
||||
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
init(channel:FlutterMethodChannel) {
|
||||
|
||||
@@ -65,7 +65,7 @@ public class MessageManager: BaseServiceManager {
|
||||
func sendMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel,result: result,methodCall: methodCall)
|
||||
Open_im_sdkSendMessage(sendMsgProgressListener, methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[string: "userID"],
|
||||
methodCall[string: "groupID"], methodCall[jsonString: "offlinePushInfo"])
|
||||
methodCall[string: "groupID"], methodCall[jsonString: "offlinePushInfo"], methodCall[bool: "isOnlineOnly"])
|
||||
}
|
||||
|
||||
func revokeMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -227,8 +227,7 @@ public class MessageManager: BaseServiceManager {
|
||||
|
||||
func sendMessageNotOss(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel,result: result,methodCall: methodCall)
|
||||
Open_im_sdkSendMessageNotOss(sendMsgProgressListener, methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[string: "userID"],
|
||||
methodCall[string: "groupID"], methodCall[jsonString: "offlinePushInfo"])
|
||||
Open_im_sdkSendMessageNotOss(sendMsgProgressListener, methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[string: "userID"], methodCall[string: "groupID"], methodCall[jsonString: "offlinePushInfo"], methodCall[bool: "isOnlineOnly"])
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
|
||||
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?) {
|
||||
var values: [String: Any] = [:]
|
||||
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)
|
||||
}
|
||||
|
||||
|
||||
public func onRecvOfflineNewMessage(_ message: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["message"] = message
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvOfflineNewMessage", errCode: nil, errMsg: nil, data: values);
|
||||
}
|
||||
public func onRecvOfflineNewMessage(_ message: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["message"] = message
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvOfflineNewMessage", errCode: nil, errMsg: nil, data: values);
|
||||
}
|
||||
|
||||
public func onRecvOnlineOnlyMessage(_ message: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["message"] = message
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvOnlineOnlyMessage", errCode: nil, errMsg: nil, data: values);
|
||||
}
|
||||
public func onRecvOnlineOnlyMessage(_ message: String?) {
|
||||
var values: [String: Any] = [:]
|
||||
values["id"] = id
|
||||
values["message"] = message
|
||||
CommonUtil.emitEvent(channel: channel, method: "advancedMsgListener", type: "onRecvOnlineOnlyMessage", errCode: nil, errMsg: nil, data: values);
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,10 +13,6 @@ public class UserManager: BaseServiceManager {
|
||||
self["unsubscribeUsersStatus"] = unsubscribeUsersStatus
|
||||
self["getSubscribeUsersStatus"] = getSubscribeUsersStatus
|
||||
self["getUserStatus"] = getUserStatus
|
||||
self["getUsersInfoWithCache"] = getUsersInfoWithCache
|
||||
/*
|
||||
self["setSelfInfoEx"] = setSelfInfoEx
|
||||
*/
|
||||
}
|
||||
|
||||
func setUserListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
@@ -51,19 +47,21 @@ public class UserManager: BaseServiceManager {
|
||||
func getUserStatus(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||
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 func onUserCommandAdd(_ userCommand: String?) {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserCommandAdd", errCode: nil, errMsg: nil, data: userCommand)
|
||||
}
|
||||
|
||||
public func onUserCommandDelete(_ userCommand: String?) {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserCommandDelete", errCode: nil, errMsg: nil, data: userCommand)
|
||||
}
|
||||
|
||||
public func onUserCommandUpdate(_ userCommand: String?) {
|
||||
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserCommandUpdate", errCode: nil, errMsg: nil, data: userCommand)
|
||||
}
|
||||
|
||||
|
||||
private let channel:FlutterMethodChannel
|
||||
|
||||
|
||||
@@ -17,9 +17,11 @@ A new Flutter project.
|
||||
s.dependency 'Flutter'
|
||||
s.platform = :ios, '11.0'
|
||||
|
||||
s.dependency 'OpenIMSDKCore','3.5.1-alpha.7'
|
||||
s.dependency 'OpenIMSDKCore','3.8.1'
|
||||
s.static_framework = true
|
||||
# s.vendored_frameworks = 'Framework/*.framework'
|
||||
s.library = 'resolv'
|
||||
|
||||
# s.vendored_frameworks = 'Framework/*.xcframework'
|
||||
# Flutter.framework does not contain a i386 slice.
|
||||
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386 arm64' }
|
||||
s.swift_version = '5.0'
|
||||
|
||||
BIN
lib/.DS_Store
vendored
BIN
lib/.DS_Store
vendored
Binary file not shown.
@@ -34,5 +34,6 @@ export 'src/models/message.dart';
|
||||
export 'src/models/notification_info.dart';
|
||||
export 'src/models/search_info.dart';
|
||||
export 'src/models/user_info.dart';
|
||||
export 'src/models/input_status_changed_data.dart';
|
||||
export 'src/openim.dart';
|
||||
export 'src/utils.dart';
|
||||
|
||||
@@ -5,8 +5,6 @@ class OnAdvancedMsgListener {
|
||||
Function(Message msg)? onMsgDeleted;
|
||||
Function(RevokedInfo info)? onNewRecvMessageRevoked;
|
||||
Function(List<ReadReceiptInfo> list)? onRecvC2CReadReceipt;
|
||||
Function(List<ReadReceiptInfo> list)? onRecvGroupReadReceipt;
|
||||
Function(String msgID, List<String> list)? onRecvMessageExtensionsDeleted;
|
||||
Function(Message msg)? onRecvNewMessage;
|
||||
Function(Message msg)? onRecvOfflineNewMessage;
|
||||
Function(Message msg)? onRecvOnlineOnlyMessage;
|
||||
@@ -18,8 +16,6 @@ class OnAdvancedMsgListener {
|
||||
this.onMsgDeleted,
|
||||
this.onNewRecvMessageRevoked,
|
||||
this.onRecvC2CReadReceipt,
|
||||
this.onRecvGroupReadReceipt,
|
||||
this.onRecvMessageExtensionsDeleted,
|
||||
this.onRecvNewMessage,
|
||||
this.onRecvOfflineNewMessage,
|
||||
this.onRecvOnlineOnlyMessage,
|
||||
@@ -39,17 +35,6 @@ class OnAdvancedMsgListener {
|
||||
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
|
||||
void recvNewMessage(Message msg) {
|
||||
onRecvNewMessage?.call(msg);
|
||||
|
||||
@@ -5,6 +5,7 @@ class OnConnectListener {
|
||||
Function()? onConnecting;
|
||||
Function()? onKickedOffline;
|
||||
Function()? onUserTokenExpired;
|
||||
Function()? onUserTokenInvalid;
|
||||
|
||||
OnConnectListener({
|
||||
this.onConnectFailed,
|
||||
@@ -12,6 +13,7 @@ class OnConnectListener {
|
||||
this.onConnecting,
|
||||
this.onKickedOffline,
|
||||
this.onUserTokenExpired,
|
||||
this.onUserTokenInvalid,
|
||||
});
|
||||
|
||||
/// SDK failed to connect to the server
|
||||
@@ -38,4 +40,8 @@ class OnConnectListener {
|
||||
void userTokenExpired() {
|
||||
onUserTokenExpired?.call();
|
||||
}
|
||||
|
||||
void userTokenInvalid() {
|
||||
onUserTokenInvalid?.call();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
/// Conversation Listener
|
||||
@@ -5,17 +6,21 @@ class OnConversationListener {
|
||||
Function(List<ConversationInfo> list)? onConversationChanged;
|
||||
Function(List<ConversationInfo> list)? onNewConversation;
|
||||
Function(int count)? onTotalUnreadMessageCountChanged;
|
||||
Function()? onSyncServerFailed;
|
||||
Function()? onSyncServerFinish;
|
||||
Function()? onSyncServerStart;
|
||||
Function(bool? reinstalled)? onSyncServerStart;
|
||||
Function(int? progress)? onSyncServerProgress;
|
||||
Function(bool? reinstalled)? onSyncServerFinish;
|
||||
Function(bool? reinstalled)? onSyncServerFailed;
|
||||
ValueChanged<InputStatusChangedData>? onInputStatusChanged;
|
||||
|
||||
OnConversationListener({
|
||||
this.onConversationChanged,
|
||||
this.onNewConversation,
|
||||
this.onTotalUnreadMessageCountChanged,
|
||||
this.onSyncServerFailed,
|
||||
this.onSyncServerFinish,
|
||||
this.onSyncServerStart,
|
||||
this.onSyncServerProgress,
|
||||
this.onSyncServerFinish,
|
||||
this.onSyncServerFailed,
|
||||
this.onInputStatusChanged,
|
||||
});
|
||||
|
||||
/// Conversations have changed
|
||||
@@ -33,15 +38,23 @@ class OnConversationListener {
|
||||
onTotalUnreadMessageCountChanged?.call(count);
|
||||
}
|
||||
|
||||
void syncServerFailed() {
|
||||
onSyncServerFailed?.call();
|
||||
void syncServerStart(bool? reinstalled) {
|
||||
onSyncServerStart?.call(reinstalled);
|
||||
}
|
||||
|
||||
void syncServerFinish() {
|
||||
onSyncServerFinish?.call();
|
||||
void syncServerProgress(int? progress) {
|
||||
onSyncServerProgress?.call(progress);
|
||||
}
|
||||
|
||||
void syncServerStart() {
|
||||
onSyncServerStart?.call();
|
||||
void syncServerFailed(bool? reinstalled) {
|
||||
onSyncServerFailed?.call(reinstalled);
|
||||
}
|
||||
|
||||
void syncServerFinish(bool? reinstalled) {
|
||||
onSyncServerFinish?.call(reinstalled);
|
||||
}
|
||||
|
||||
void conversationUserInputStatusChanged(InputStatusChangedData data) {
|
||||
onInputStatusChanged?.call(data);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,16 +8,25 @@ class OnUploadLogsListener {
|
||||
}
|
||||
|
||||
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, String partHash, String fileHash)? onHashPartComplete;
|
||||
Function(String id, int index, int size, String partHash)? onHashPartProgress;
|
||||
Function(String id, int size)? onOpen;
|
||||
Function(String id, int partSize, int num)? onPartSize;
|
||||
Function(String id, int fileSize, int streamSize, int storageSize)?
|
||||
onUploadProgress;
|
||||
Function(String id, int fileSize, int streamSize, int storageSize)? onUploadProgress;
|
||||
Function(String id, String uploadID)? onUploadID;
|
||||
Function(String id, int index, int partSize, String partHash)?
|
||||
onUploadPartComplete;
|
||||
Function(String id, int index, int partSize, String partHash)? onUploadPartComplete;
|
||||
|
||||
void complete(String id, int size, String url, int type) {
|
||||
onComplete?.call(id, size, url, type);
|
||||
@@ -39,8 +48,7 @@ class OnUploadFileListener {
|
||||
onPartSize?.call(id, partSize, num);
|
||||
}
|
||||
|
||||
void uploadProgress(
|
||||
String id, int fileSize, int streamSize, int storageSize) {
|
||||
void uploadProgress(String id, int fileSize, int streamSize, int storageSize) {
|
||||
onUploadProgress?.call(id, fileSize, streamSize, storageSize);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
import 'dart:async';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
import '../models/update_req.dart';
|
||||
|
||||
class ConversationManager {
|
||||
MethodChannel _channel;
|
||||
late OnConversationListener listener;
|
||||
@@ -98,14 +101,11 @@ class ConversationManager {
|
||||
required String conversationID,
|
||||
required bool isPinned,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'pinConversation',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"isPinned": isPinned,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
}) {
|
||||
final req = ConversationReq(isPinned: isPinned);
|
||||
|
||||
return setConversation(conversationID, req, operationID: operationID);
|
||||
}
|
||||
|
||||
/// Hide a Conversation
|
||||
/// [conversationID] Conversation ID
|
||||
@@ -161,22 +161,20 @@ class ConversationManager {
|
||||
/// Message Do-Not-Disturb Setting
|
||||
/// [conversationID] Conversation ID
|
||||
/// [status] 0: normal; 1: not receiving messages; 2: receive online messages but not offline messages
|
||||
@Deprecated('use [setConversation] instead')
|
||||
Future<dynamic> setConversationRecvMessageOpt({
|
||||
required String conversationID,
|
||||
required int status,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setConversationRecvMessageOpt',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"status": status,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
}) {
|
||||
final req = ConversationReq(recvMsgOpt: status);
|
||||
|
||||
/// Query Do-Not-Disturb Status
|
||||
/// [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
|
||||
return setConversation(conversationID, req, operationID: operationID);
|
||||
}
|
||||
|
||||
/// 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({
|
||||
required List<String> conversationIDList,
|
||||
String? operationID,
|
||||
@@ -193,18 +191,16 @@ class ConversationManager {
|
||||
/// Self-Destruct Messages
|
||||
/// [conversationID] Conversation ID
|
||||
/// [isPrivate] true: enable, false: disable
|
||||
@Deprecated('use [setConversation] instead')
|
||||
Future<dynamic> setConversationPrivateChat({
|
||||
required String conversationID,
|
||||
required bool isPrivate,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setConversationPrivateChat',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"isPrivate": isPrivate,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
}) {
|
||||
final req = ConversationReq(isPrivateChat: isPrivate);
|
||||
|
||||
return setConversation(conversationID, req, operationID: operationID);
|
||||
}
|
||||
|
||||
/// Delete a Conversation Locally and from the Server
|
||||
/// [conversationID] Conversation ID
|
||||
@@ -245,16 +241,15 @@ class ConversationManager {
|
||||
|
||||
/// Reset Mentioned (Group At) Flags [GroupAtType]
|
||||
/// [conversationID] Conversation ID
|
||||
@Deprecated('use [setConversation] instead')
|
||||
Future<dynamic> resetConversationGroupAtType({
|
||||
required String conversationID,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'resetConversationGroupAtType',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
}) {
|
||||
final req = ConversationReq(groupAtType: 0);
|
||||
|
||||
return setConversation(conversationID, req, operationID: operationID);
|
||||
}
|
||||
|
||||
/// Query @ All Flag
|
||||
Future<dynamic> getAtAllTag({
|
||||
@@ -271,32 +266,27 @@ class ConversationManager {
|
||||
|
||||
/// Global Do-Not-Disturb
|
||||
/// [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({
|
||||
required int status,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setGlobalRecvMessageOpt',
|
||||
_buildParam({
|
||||
"status": status,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
}) {
|
||||
throw UnimplementedError('setGlobalRecvMessageOpt');
|
||||
}
|
||||
|
||||
/// Set Self-Destruct Message Duration
|
||||
/// [conversationID] Conversation ID
|
||||
/// [burnDuration] Duration in seconds, default: 30s
|
||||
@Deprecated('use [setConversation] instead')
|
||||
Future<dynamic> setConversationBurnDuration({
|
||||
required String conversationID,
|
||||
int burnDuration = 30,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setConversationBurnDuration',
|
||||
_buildParam({
|
||||
"conversationID": conversationID,
|
||||
"burnDuration": burnDuration,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
}) {
|
||||
final req = ConversationReq(burnDuration: burnDuration);
|
||||
|
||||
return setConversation(conversationID, req, operationID: operationID);
|
||||
}
|
||||
|
||||
/// Mark Messages as Read
|
||||
/// [conversationID] Conversation ID
|
||||
@@ -311,36 +301,6 @@ class ConversationManager {
|
||||
"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
|
||||
Future<List<ConversationInfo>> searchConversations(
|
||||
String name, {
|
||||
@@ -356,20 +316,15 @@ class ConversationManager {
|
||||
.then((value) => Utils.toList(value, (map) => ConversationInfo.fromJson(map)));
|
||||
}
|
||||
|
||||
Future<List<ConversationInfo>> setConversationEx(
|
||||
@Deprecated('use [setConversation] instead')
|
||||
Future setConversationEx(
|
||||
String conversationID, {
|
||||
String? ex,
|
||||
String? operationID,
|
||||
}) {
|
||||
return _channel
|
||||
.invokeMethod(
|
||||
'setConversationEx',
|
||||
_buildParam({
|
||||
'conversationID': conversationID,
|
||||
'ex': ex,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => ConversationInfo.fromJson(map)));
|
||||
final req = ConversationReq(ex: ex);
|
||||
|
||||
return setConversation(conversationID, req, operationID: operationID);
|
||||
}
|
||||
|
||||
/// Custom Sort for Conversation List
|
||||
@@ -392,9 +347,68 @@ class ConversationManager {
|
||||
}
|
||||
});
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
Future changeInputStates({
|
||||
required String conversationID,
|
||||
required bool focus,
|
||||
String? operationID,
|
||||
}) {
|
||||
return _channel.invokeMethod(
|
||||
'changeInputStates',
|
||||
_buildParam(
|
||||
{
|
||||
'focus': focus,
|
||||
'conversationID': conversationID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<List<int>?> getInputStates(
|
||||
String conversationID,
|
||||
String userID, {
|
||||
String? operationID,
|
||||
}) {
|
||||
return _channel
|
||||
.invokeMethod(
|
||||
'getInputStates',
|
||||
_buildParam(
|
||||
{
|
||||
'conversationID': conversationID,
|
||||
'userID': userID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
},
|
||||
),
|
||||
)
|
||||
.then((value) {
|
||||
print('getInputStates: $value');
|
||||
final result = Utils.toListMap(value);
|
||||
return List<int>.from(result);
|
||||
});
|
||||
}
|
||||
|
||||
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 = Utils.cleanMap(param);
|
||||
log('param: $param');
|
||||
|
||||
return param;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
import '../models/update_req.dart';
|
||||
|
||||
class FriendshipManager {
|
||||
MethodChannel _channel;
|
||||
late OnFriendshipListener listener;
|
||||
@@ -15,8 +19,9 @@ class FriendshipManager {
|
||||
|
||||
/// Query Friend Information
|
||||
/// [userIDList] List of user IDs
|
||||
Future<List<FullUserInfo>> getFriendsInfo({
|
||||
Future<List<PublicUserInfo>> getFriendsInfo({
|
||||
required List<String> userIDList,
|
||||
bool filterBlack = false,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
@@ -24,9 +29,10 @@ class FriendshipManager {
|
||||
'getFriendsInfo',
|
||||
_buildParam({
|
||||
"userIDList": userIDList,
|
||||
'filterBlack': filterBlack,
|
||||
"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.
|
||||
/// [userID] User ID to be invited
|
||||
@@ -63,13 +69,35 @@ class FriendshipManager {
|
||||
.then((value) => Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v)));
|
||||
|
||||
/// Get Friend List, including friends who have been put into the blacklist
|
||||
Future<List<FullUserInfo>> getFriendList({String? operationID}) => _channel
|
||||
.invokeMethod(
|
||||
'getFriendList',
|
||||
_buildParam({
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (v) => FullUserInfo.fromJson(v)));
|
||||
Future<List<PublicUserInfo>> getFriendList({
|
||||
String? operationID,
|
||||
bool filterBlack = false,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getFriendList',
|
||||
_buildParam({
|
||||
'filterBlack': filterBlack,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (v) => PublicUserInfo.fromJson(v)));
|
||||
|
||||
Future<List<PublicUserInfo>> getFriendListPage({
|
||||
bool filterBlack = false,
|
||||
int offset = 0,
|
||||
int count = 40,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'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)
|
||||
Future<List<dynamic>> getFriendListMap({String? operationID}) => _channel
|
||||
@@ -80,21 +108,36 @@ class FriendshipManager {
|
||||
}))
|
||||
.then((value) => Utils.toListMap(value));
|
||||
|
||||
Future<List<dynamic>> getFriendListPageMap({
|
||||
bool filterBlack = false,
|
||||
String? operationID,
|
||||
int offset = 0,
|
||||
int count = 40,
|
||||
}) =>
|
||||
_channel
|
||||
.invokeMethod(
|
||||
'getFriendListPage',
|
||||
_buildParam({
|
||||
'offset': offset,
|
||||
'count': count,
|
||||
'filterBlack': filterBlack,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toListMap(value));
|
||||
|
||||
/// Set Friend's Remark
|
||||
/// [userID] Friend's userID
|
||||
/// [remark] Friend's remark
|
||||
@Deprecated('Use [updateFriends] instead')
|
||||
Future<dynamic> setFriendRemark({
|
||||
required String userID,
|
||||
required String remark,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setFriendRemark',
|
||||
_buildParam({
|
||||
'toUserID': userID,
|
||||
'remark': remark,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
}) {
|
||||
final req = UpdateFriendsReq(friendUserIDs: [userID], remark: remark);
|
||||
|
||||
return updateFriends(req, operationID: operationID);
|
||||
}
|
||||
|
||||
/// Add to Blacklist
|
||||
/// [userID] Friend's ID to be added to the blacklist
|
||||
@@ -219,22 +262,35 @@ class FriendshipManager {
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => SearchFriendsInfo.fromJson(map)));
|
||||
|
||||
Future<String?> setFriendsEx(
|
||||
@Deprecated('Use [updateFriends] instead')
|
||||
Future setFriendsEx(
|
||||
List<String> friendIDs, {
|
||||
String? ex,
|
||||
String? operationID,
|
||||
}) {
|
||||
return _channel.invokeMethod(
|
||||
'setFriendsEx',
|
||||
_buildParam({
|
||||
"friendIDs": friendIDs,
|
||||
"ex": ex,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
final req = UpdateFriendsReq(friendUserIDs: friendIDs, ex: ex);
|
||||
|
||||
return updateFriends(req, operationID: 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 = Utils.cleanMap(param);
|
||||
|
||||
return param;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'dart:developer';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
import 'package:flutter_openim_sdk/src/models/set_group_member_info.dart';
|
||||
|
||||
class GroupManager {
|
||||
MethodChannel _channel;
|
||||
@@ -131,6 +132,16 @@ class GroupManager {
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
|
||||
|
||||
Future<List<GroupInfo>> getJoinedGroupListPage({String? operationID, int offset = 0, int count = 40}) => _channel
|
||||
.invokeMethod(
|
||||
'getJoinedGroupListPage',
|
||||
_buildParam({
|
||||
'offset': offset,
|
||||
'count': count,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
|
||||
|
||||
/// Query the list of joined groups
|
||||
Future<List<dynamic>> getJoinedGroupListMap({String? operationID}) => _channel
|
||||
.invokeMethod(
|
||||
@@ -207,15 +218,17 @@ class GroupManager {
|
||||
|
||||
/// Apply to join a group, requiring approval from an administrator or the group.
|
||||
/// [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(
|
||||
'joinGroup',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'reason': reason,
|
||||
'joinSource': joinSource,
|
||||
'ex': ex,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
Future<dynamic> joinGroup(
|
||||
{required String groupID, String? reason, String? operationID, int joinSource = 3, String? ex}) =>
|
||||
_channel.invokeMethod(
|
||||
'joinGroup',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'reason': reason,
|
||||
'joinSource': joinSource,
|
||||
'ex': ex,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// Exit a group
|
||||
Future<dynamic> quitGroup({
|
||||
@@ -351,20 +364,17 @@ class GroupManager {
|
||||
/// [groupID] Group ID
|
||||
/// [userID] User ID of the group member
|
||||
/// [groupNickname] Group nickname
|
||||
@Deprecated('Use [setGroupMemberInfo] instead')
|
||||
Future<dynamic> setGroupMemberNickname({
|
||||
required String groupID,
|
||||
required String userID,
|
||||
String? groupNickname,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setGroupMemberNickname',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'userID': userID,
|
||||
'groupNickname': groupNickname ?? '',
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
}) {
|
||||
final req = SetGroupMemberInfo(groupID: groupID, userID: userID, nickname: groupNickname);
|
||||
|
||||
return setGroupMemberInfo(groupMembersInfo: req, operationID: operationID);
|
||||
}
|
||||
|
||||
/// Query a group
|
||||
/// [keywordList] Search keywords; currently, only one keyword is supported, and it cannot be empty.
|
||||
@@ -393,20 +403,17 @@ class GroupManager {
|
||||
/// [groupID] Group ID
|
||||
/// [userID] User ID of the group member
|
||||
/// [roleLevel] Role level; see [GroupRoleLevel]
|
||||
@Deprecated('Use [setGroupMemberInfo] instead')
|
||||
Future<dynamic> setGroupMemberRoleLevel({
|
||||
required String groupID,
|
||||
required String userID,
|
||||
required int roleLevel,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setGroupMemberRoleLevel',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'userID': userID,
|
||||
'roleLevel': roleLevel,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
}) {
|
||||
final req = SetGroupMemberInfo(groupID: groupID, userID: userID, roleLevel: roleLevel);
|
||||
|
||||
return setGroupMemberInfo(groupMembersInfo: req, operationID: operationID);
|
||||
}
|
||||
|
||||
/// Get a group member list based on join time
|
||||
Future<List<GroupMembersInfo>> getGroupMemberListByJoinTime({
|
||||
@@ -435,50 +442,44 @@ class GroupManager {
|
||||
/// Set group verification for joining
|
||||
/// [groupID] Group ID
|
||||
/// [needVerification] Verification setting; see [GroupVerification] class
|
||||
@Deprecated('Use [setGroupInfo] instead')
|
||||
Future<dynamic> setGroupVerification({
|
||||
required String groupID,
|
||||
required int needVerification,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setGroupVerification',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'needVerification': needVerification,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
}) {
|
||||
final req = GroupInfo(groupID: groupID, needVerification: needVerification);
|
||||
|
||||
/// Allow/disallow members to view each other's information through the group
|
||||
/// [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),
|
||||
}));
|
||||
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> 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({
|
||||
required String groupID,
|
||||
required int status,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setGroupApplyMemberFriend',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'status': status,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
}) {
|
||||
final req = GroupInfo(groupID: groupID, applyMemberFriend: status);
|
||||
|
||||
return setGroupInfo(req, operationID: operationID);
|
||||
}
|
||||
|
||||
/// Get group owners and administrators
|
||||
/// [groupId] Group ID
|
||||
@@ -561,7 +562,7 @@ class GroupManager {
|
||||
|
||||
/// Modify the GroupMemberInfo ex field
|
||||
Future<dynamic> setGroupMemberInfo({
|
||||
required GroupMembersInfo groupMembersInfo,
|
||||
required SetGroupMemberInfo groupMembersInfo,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
@@ -570,9 +571,27 @@ class GroupManager {
|
||||
'info': groupMembersInfo.toJson(),
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
static Map _buildParam(Map param) {
|
||||
|
||||
Future<dynamic> getUsersInGroup(
|
||||
String groupID,
|
||||
List<String> userIDs, {
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'getUsersInGroup',
|
||||
_buildParam({
|
||||
'groupID': groupID,
|
||||
'userIDs': userIDs,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
static Map _buildParam(Map<String, dynamic> param) {
|
||||
param["ManagerName"] = "groupManager";
|
||||
param = Utils.cleanMap(param);
|
||||
log('param: $param');
|
||||
|
||||
return param;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
|
||||
@@ -56,6 +57,9 @@ class IMManager {
|
||||
case 'onUserTokenExpired':
|
||||
_connectListener.userTokenExpired();
|
||||
break;
|
||||
case 'onUserTokenInvalid':
|
||||
_connectListener.userTokenInvalid();
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.userListener) {
|
||||
String type = call.arguments['type'];
|
||||
@@ -138,18 +142,6 @@ class IMManager {
|
||||
var list = Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
||||
messageManager.msgListener.recvC2CReadReceipt(list);
|
||||
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':
|
||||
var value = call.arguments['data']['message'];
|
||||
final msg = Utils.toObj(value, (map) => Message.fromJson(map));
|
||||
@@ -184,14 +176,17 @@ class IMManager {
|
||||
dynamic data = call.arguments['data'];
|
||||
switch (type) {
|
||||
case 'onSyncServerStart':
|
||||
conversationManager.listener.syncServerStart();
|
||||
print('dart onSyncServerStart: $data');
|
||||
conversationManager.listener.syncServerStart(data);
|
||||
break;
|
||||
case 'onSyncServerProgress':
|
||||
conversationManager.listener.syncServerProgress(data);
|
||||
break;
|
||||
case 'onSyncServerFinish':
|
||||
conversationManager.listener.syncServerFinish();
|
||||
conversationManager.listener.syncServerFinish(data);
|
||||
break;
|
||||
|
||||
case 'onSyncServerFailed':
|
||||
conversationManager.listener.syncServerFailed();
|
||||
conversationManager.listener.syncServerFailed(data);
|
||||
break;
|
||||
case 'onNewConversation':
|
||||
var list = Utils.toList(data, (map) => ConversationInfo.fromJson(map));
|
||||
@@ -204,6 +199,10 @@ class IMManager {
|
||||
case 'onTotalUnreadMessageCountChanged':
|
||||
conversationManager.listener.totalUnreadMessageCountChanged(data ?? 0);
|
||||
break;
|
||||
case 'onConversationUserInputStatusChanged':
|
||||
final i = Utils.toObj(data, (map) => InputStatusChangedData.fromJson(map));
|
||||
conversationManager.listener.conversationUserInputStatusChanged(i);
|
||||
break;
|
||||
}
|
||||
} else if (call.method == ListenerType.friendListener) {
|
||||
String type = call.arguments['type'];
|
||||
@@ -357,10 +356,8 @@ class IMManager {
|
||||
OnConnectListener listener, {
|
||||
String? operationID,
|
||||
}) {
|
||||
this._connectListener = listener;
|
||||
if (config.logFilePath == null) {
|
||||
config.logFilePath = config.dataDir;
|
||||
}
|
||||
_connectListener = listener;
|
||||
config.logFilePath ??= config.dataDir;
|
||||
return _channel.invokeMethod(
|
||||
'initSDK',
|
||||
_buildParam(
|
||||
@@ -377,7 +374,6 @@ class IMManager {
|
||||
/// [apiAddr] SDK API address
|
||||
/// [wsAddr] SDK WebSocket address
|
||||
/// [dataDir] SDK database storage directory
|
||||
/// [objectStorage] Object storage minio
|
||||
/// [logLevel] Log level, 1: no printing
|
||||
/// [enabledEncryption] true: encryption
|
||||
/// [enabledCompression] true: compression
|
||||
@@ -388,12 +384,13 @@ class IMManager {
|
||||
required String dataDir,
|
||||
required OnConnectListener listener,
|
||||
int logLevel = 6,
|
||||
bool isNeedEncryption = false,
|
||||
bool isCompression = false,
|
||||
bool isLogStandardOutput = true,
|
||||
String? logFilePath,
|
||||
String? operationID,
|
||||
}) {
|
||||
this._connectListener = listener;
|
||||
_connectListener = listener;
|
||||
return _channel.invokeMethod(
|
||||
'initSDK',
|
||||
_buildParam(
|
||||
@@ -404,8 +401,10 @@ class IMManager {
|
||||
"dataDir": dataDir,
|
||||
"logLevel": logLevel,
|
||||
"isCompression": isCompression,
|
||||
'isNeedEncryption': isNeedEncryption,
|
||||
"isLogStandardOutput": isLogStandardOutput,
|
||||
"logFilePath": logFilePath,
|
||||
'systemType': 'flutter',
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
},
|
||||
),
|
||||
@@ -525,16 +524,38 @@ class IMManager {
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
|
||||
/// 上传日志
|
||||
/// [uploadlogParams] ex
|
||||
/// Upload logs
|
||||
Future uploadLogs({
|
||||
String? ex,
|
||||
int line = 0,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'uploadLogs',
|
||||
_buildParam({
|
||||
'ex': ex,
|
||||
'line': line,
|
||||
'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),
|
||||
}));
|
||||
|
||||
@@ -558,8 +579,10 @@ class IMManager {
|
||||
|
||||
MethodChannel get channel => _channel;
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
static Map _buildParam(Map<String, dynamic> param) {
|
||||
param["ManagerName"] = "imManager";
|
||||
param = Utils.cleanMap(param);
|
||||
|
||||
return param;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ class MessageManager {
|
||||
required OfflinePushInfo offlinePushInfo,
|
||||
String? userID,
|
||||
String? groupID,
|
||||
bool isOnlineOnly = false,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
@@ -46,6 +47,7 @@ class MessageManager {
|
||||
'offlinePushInfo': offlinePushInfo.toJson(),
|
||||
'userID': userID ?? '',
|
||||
'groupID': groupID ?? '',
|
||||
'isOnlineOnly': isOnlineOnly,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||
@@ -145,18 +147,14 @@ class MessageManager {
|
||||
|
||||
/// Typing status update
|
||||
/// [msgTip] Custom content
|
||||
@Deprecated('Use [OpenIM.iMManager.conversationManager.changeInputStates(conversationID:focus:)] instead')
|
||||
Future typingStatusUpdate({
|
||||
required String userID,
|
||||
String? msgTip,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'typingStatusUpdate',
|
||||
_buildParam({
|
||||
"msgTip": msgTip,
|
||||
"userID": userID,
|
||||
"operationID": Utils.checkOperationID(operationID),
|
||||
}));
|
||||
}) {
|
||||
throw UnimplementedError('typingStatusUpdate');
|
||||
}
|
||||
|
||||
/// Create a text message
|
||||
Future<Message> createTextMessage({
|
||||
@@ -529,8 +527,7 @@ class MessageManager {
|
||||
},
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (map) => SearchResult.fromJson(map)));
|
||||
.then((value) => Utils.toObj(value, (map) => SearchResult.fromJson(map)));
|
||||
|
||||
/// Revoke a message
|
||||
/// [message] The message to be revoked
|
||||
@@ -550,6 +547,7 @@ class MessageManager {
|
||||
/// Mark messages as read
|
||||
/// [conversationID] Conversation ID
|
||||
/// [messageIDList] List of clientMsgIDs of messages to be marked as read
|
||||
@Deprecated('Use markConversationMessageAsRead instead')
|
||||
Future markMessagesAsReadByMsgID({
|
||||
required String conversationID,
|
||||
required List<String> messageIDList,
|
||||
@@ -585,8 +583,7 @@ class MessageManager {
|
||||
'lastMinSeq': lastMinSeq ?? 0,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (map) => AdvancedMessage.fromJson(map)));
|
||||
.then((value) => Utils.toObj(value, (map) => AdvancedMessage.fromJson(map)));
|
||||
|
||||
/// Get chat history (newly received chat history after startMsg). Used for locating a specific message in global search and then fetching messages received after that message.
|
||||
/// [conversationID] Conversation ID, can be used for querying notifications
|
||||
@@ -609,8 +606,7 @@ class MessageManager {
|
||||
'lastMinSeq': lastMinSeq ?? 0,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (map) => AdvancedMessage.fromJson(map)));
|
||||
.then((value) => Utils.toObj(value, (map) => AdvancedMessage.fromJson(map)));
|
||||
|
||||
/// Find message details
|
||||
/// [conversationID] Conversation ID
|
||||
@@ -626,8 +622,7 @@ class MessageManager {
|
||||
'searchParams': searchParams.map((e) => e.toJson()).toList(),
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) =>
|
||||
Utils.toObj(value, (map) => SearchResult.fromJson(map)));
|
||||
.then((value) => Utils.toObj(value, (map) => SearchResult.fromJson(map)));
|
||||
|
||||
/// Rich text message
|
||||
/// [text] Input content
|
||||
@@ -679,6 +674,7 @@ class MessageManager {
|
||||
required OfflinePushInfo offlinePushInfo,
|
||||
String? userID,
|
||||
String? groupID,
|
||||
bool isOnlineOnly = false,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel
|
||||
@@ -689,6 +685,7 @@ class MessageManager {
|
||||
'offlinePushInfo': offlinePushInfo.toJson(),
|
||||
'userID': userID ?? '',
|
||||
'groupID': groupID ?? '',
|
||||
'isOnlineOnly': isOnlineOnly,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||
@@ -779,7 +776,8 @@ class MessageManager {
|
||||
}));
|
||||
}
|
||||
|
||||
Future setAppBadge(int count, {
|
||||
Future setAppBadge(
|
||||
int count, {
|
||||
String? operationID,
|
||||
}) {
|
||||
return _channel.invokeMethod(
|
||||
@@ -790,8 +788,10 @@ class MessageManager {
|
||||
}));
|
||||
}
|
||||
|
||||
static Map _buildParam(Map param) {
|
||||
static Map _buildParam(Map<String, dynamic> param) {
|
||||
param["ManagerName"] = "messageManager";
|
||||
param = Utils.cleanMap(param);
|
||||
|
||||
return param;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class UserManager {
|
||||
|
||||
/// Get user information
|
||||
/// [userIDList] List of user IDs
|
||||
Future<List<FullUserInfo>> getUsersInfo({
|
||||
Future<List<PublicUserInfo>> getUsersInfo({
|
||||
required List<String> userIDList,
|
||||
String? operationID,
|
||||
}) =>
|
||||
@@ -26,7 +26,7 @@ class UserManager {
|
||||
'userIDList': userIDList,
|
||||
'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
|
||||
Future<UserInfo> getSelfUserInfo({
|
||||
@@ -48,17 +48,16 @@ class UserManager {
|
||||
Future<String?> setSelfInfo({
|
||||
String? nickname,
|
||||
String? faceURL,
|
||||
int? appManagerLevel,
|
||||
int? globalRecvMsgOpt,
|
||||
String? ex,
|
||||
String? operationID,
|
||||
}) =>
|
||||
_channel.invokeMethod(
|
||||
'setSelfInfo',
|
||||
_buildParam({
|
||||
// 'userID': userID,
|
||||
'nickname': nickname,
|
||||
'faceURL': faceURL,
|
||||
'appManagerLevel': appManagerLevel,
|
||||
'globalRecvMsgOpt': globalRecvMsgOpt,
|
||||
'ex': ex,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
@@ -115,37 +114,28 @@ class UserManager {
|
||||
.then((value) => Utils.toList(value, (map) => UserStatusInfo.fromJson(map)));
|
||||
}
|
||||
|
||||
Future<List<FullUserInfo>> getUsersInfoWithCache(
|
||||
@Deprecated('Use [getUsersInfo] instead')
|
||||
Future<List<PublicUserInfo>> getUsersInfoWithCache(
|
||||
List<String> userIDs, {
|
||||
String? groupID,
|
||||
String? operationID,
|
||||
}) {
|
||||
return _channel
|
||||
.invokeMethod(
|
||||
'getUsersInfoWithCache',
|
||||
_buildParam({
|
||||
'userIDs': userIDs,
|
||||
'groupID': groupID,
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}))
|
||||
.then((value) => Utils.toList(value, (map) => FullUserInfo.fromJson(map)));
|
||||
return getUsersInfo(userIDList: userIDs, operationID: operationID);
|
||||
}
|
||||
|
||||
/*
|
||||
Future<String?> setSelfUserInfoEx(
|
||||
UserInfo userInfo, {
|
||||
/// Global Do Not Disturb
|
||||
/// [status] 0: Normal; 1: Do not accept messages; 2: Accept online messages but not offline messages;
|
||||
@Deprecated('use [setSelfInfo] instead')
|
||||
Future<dynamic> setGlobalRecvMessageOpt({
|
||||
required int status,
|
||||
String? operationID,
|
||||
}) {
|
||||
return _channel.invokeMethod(
|
||||
'setSelfUserInfoEx',
|
||||
_buildParam({
|
||||
...userInfo.toJson(),
|
||||
'operationID': Utils.checkOperationID(operationID),
|
||||
}));
|
||||
return setSelfInfo(globalRecvMsgOpt: status);
|
||||
}
|
||||
*/
|
||||
static Map _buildParam(Map param) {
|
||||
|
||||
static Map _buildParam(Map<String, dynamic> param) {
|
||||
param["ManagerName"] = "userManager";
|
||||
param = Utils.cleanMap(param);
|
||||
|
||||
return param;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,16 +115,11 @@ class GroupInfo {
|
||||
}
|
||||
|
||||
/// Corresponding Conversation Type for Group Type
|
||||
int get sessionType => groupType == GroupType.general
|
||||
? ConversationType.group
|
||||
: ConversationType.superGroup;
|
||||
int get sessionType => groupType == GroupType.general ? ConversationType.group : ConversationType.superGroup;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is GroupInfo &&
|
||||
runtimeType == other.runtimeType &&
|
||||
groupID == other.groupID;
|
||||
identical(this, other) || other is GroupInfo && runtimeType == other.runtimeType && groupID == other.groupID;
|
||||
|
||||
@override
|
||||
int get hashCode => groupID.hashCode;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class InitConfig {
|
||||
String systemType;
|
||||
int platformID;
|
||||
String apiAddr;
|
||||
String wsAddr;
|
||||
@@ -6,6 +7,7 @@ class InitConfig {
|
||||
int logLevel;
|
||||
bool isLogStandardOutput;
|
||||
String? logFilePath;
|
||||
bool enabledCompression;
|
||||
|
||||
InitConfig({
|
||||
required this.platformID,
|
||||
@@ -15,18 +17,21 @@ class InitConfig {
|
||||
this.logLevel = 6,
|
||||
this.isLogStandardOutput = true,
|
||||
this.logFilePath,
|
||||
this.enabledCompression = false,
|
||||
this.systemType = 'flutter',
|
||||
});
|
||||
|
||||
factory InitConfig.fromJson(Map<String, dynamic> json) {
|
||||
return InitConfig(
|
||||
platformID: json['platformID'],
|
||||
apiAddr: json['apiAddr'],
|
||||
wsAddr: json['wsAddr'],
|
||||
dataDir: json['dataDir'],
|
||||
logLevel: json['logLevel'],
|
||||
isLogStandardOutput: json['isLogStandardOutput'],
|
||||
logFilePath: json['logFilePath'],
|
||||
);
|
||||
platformID: json['platformID'],
|
||||
apiAddr: json['apiAddr'],
|
||||
wsAddr: json['wsAddr'],
|
||||
dataDir: json['dataDir'],
|
||||
logLevel: json['logLevel'],
|
||||
isLogStandardOutput: json['isLogStandardOutput'],
|
||||
logFilePath: json['logFilePath'],
|
||||
enabledCompression: json['isCompression'],
|
||||
systemType: json['systemType']);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
@@ -38,6 +43,8 @@ class InitConfig {
|
||||
'logLevel': logLevel,
|
||||
'isLogStandardOutput': isLogStandardOutput,
|
||||
'logFilePath': logFilePath,
|
||||
'isCompression': enabledCompression,
|
||||
'systemType': systemType,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
24
lib/src/models/input_status_changed_data.dart
Normal file
24
lib/src/models/input_status_changed_data.dart
Normal file
@@ -0,0 +1,24 @@
|
||||
class InputStatusChangedData {
|
||||
final String userID;
|
||||
final String conversationID;
|
||||
final List<int>? platformIDs;
|
||||
|
||||
InputStatusChangedData({
|
||||
required this.userID,
|
||||
required this.conversationID,
|
||||
this.platformIDs,
|
||||
});
|
||||
|
||||
InputStatusChangedData.fromJson(Map<String, dynamic> json)
|
||||
: userID = json['userID'],
|
||||
conversationID = json['conversationID'],
|
||||
platformIDs = List<int>.from(json['platformIDs'] ?? []);
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final data = <String, dynamic>{};
|
||||
data['userID'] = userID;
|
||||
data['conversationID'] = conversationID;
|
||||
data['platformIDs'] = platformIDs;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
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 {
|
||||
/// User ID
|
||||
String? userID;
|
||||
|
||||
@@ -2,9 +2,9 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||
|
||||
class OpenIM {
|
||||
static const version = '3.5.1-alpha.7';
|
||||
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);
|
||||
|
||||
|
||||
@@ -4,13 +4,21 @@ class Utils {
|
||||
static List<T> toList<T>(String value, T f(Map<String, dynamic> map)) =>
|
||||
(formatJson(value) as List).map((e) => f(e)).toList();
|
||||
|
||||
static T toObj<T>(String value, T f(Map<String, dynamic> map)) =>
|
||||
f(formatJson(value));
|
||||
static T toObj<T>(String value, T f(Map<String, dynamic> map)) => f(formatJson(value));
|
||||
|
||||
static List<dynamic> toListMap(String value) => formatJson(value);
|
||||
|
||||
static dynamic formatJson(String value) => jsonDecode(value);
|
||||
|
||||
static String checkOperationID(String? obj) =>
|
||||
obj ?? DateTime.now().millisecondsSinceEpoch.toString();
|
||||
static String checkOperationID(String? obj) => 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;
|
||||
}
|
||||
}
|
||||
|
||||
56
pubspec.lock
56
pubspec.lock
@@ -59,38 +59,62 @@ packages:
|
||||
description: flutter
|
||||
source: sdk
|
||||
version: "0.0.0"
|
||||
leak_tracker:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker
|
||||
sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "10.0.4"
|
||||
leak_tracker_flutter_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_flutter_testing
|
||||
sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.3"
|
||||
leak_tracker_testing:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: leak_tracker_testing
|
||||
sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "3.0.1"
|
||||
matcher:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: matcher
|
||||
sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e"
|
||||
sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.12.16"
|
||||
version: "0.12.16+1"
|
||||
material_color_utilities:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: material_color_utilities
|
||||
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
|
||||
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.5.0"
|
||||
version: "0.8.0"
|
||||
meta:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: meta
|
||||
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
|
||||
sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.10.0"
|
||||
version: "1.12.0"
|
||||
path:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: path
|
||||
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
|
||||
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "1.8.3"
|
||||
version: "1.9.0"
|
||||
sky_engine:
|
||||
dependency: transitive
|
||||
description: flutter
|
||||
@@ -140,10 +164,10 @@ packages:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: test_api
|
||||
sha256: "5c2f730018264d276c20e4f1503fd1308dfbbae39ec8ee63c5236311ac06954b"
|
||||
sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.6.1"
|
||||
version: "0.7.0"
|
||||
vector_math:
|
||||
dependency: transitive
|
||||
description:
|
||||
@@ -152,14 +176,14 @@ packages:
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "2.1.4"
|
||||
web:
|
||||
vm_service:
|
||||
dependency: transitive
|
||||
description:
|
||||
name: web
|
||||
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
|
||||
name: vm_service
|
||||
sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec"
|
||||
url: "https://pub.dev"
|
||||
source: hosted
|
||||
version: "0.3.0"
|
||||
version: "14.2.1"
|
||||
sdks:
|
||||
dart: ">=3.2.0-194.0.dev <4.0.0"
|
||||
flutter: ">=1.20.0"
|
||||
dart: ">=3.3.0 <4.0.0"
|
||||
flutter: ">=3.18.0-18.0.pre.54"
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
name: flutter_openim_sdk
|
||||
description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source.
|
||||
version: 3.5.1-alpha.7
|
||||
version: 3.8.1
|
||||
homepage: https://www.openim.io
|
||||
repository: https://github.com/openimsdk/open-im-sdk-flutter
|
||||
|
||||
environment:
|
||||
sdk: ">=2.12.0 <4.0.0"
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
flutter: ">=1.20.0"
|
||||
|
||||
dependencies:
|
||||
|
||||
Reference in New Issue
Block a user