new_version1

This commit is contained in:
hrxiang
2022-02-16 15:36:37 +08:00
parent cd0865853b
commit f3261d2ce4
99 changed files with 4404 additions and 3093 deletions

View File

@@ -41,5 +41,5 @@ android {
}
}
dependencies {
implementation 'io.openim:client-sdk:1.4.5@aar'
implementation 'io.openim:client-sdk:1.5.4@aar'
}

View File

@@ -18,6 +18,7 @@ import io.openim.flutter_openim_sdk.manager.FriendshipManager;
import io.openim.flutter_openim_sdk.manager.GroupManager;
import io.openim.flutter_openim_sdk.manager.IMManager;
import io.openim.flutter_openim_sdk.manager.MessageManager;
import io.openim.flutter_openim_sdk.manager.UserManager;
/**
@@ -31,6 +32,7 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler
public static MethodChannel channel;
private static IMManager imManager;
private static UserManager userManager;
private static FriendshipManager friendshipManager;
private static MessageManager messageManager;
private static ConversationManager conversationManager;
@@ -41,6 +43,7 @@ public class FlutterOpenimSdkPlugin implements FlutterPlugin, MethodCallHandler
private FlutterOpenimSdkPlugin(Context context) {
FlutterOpenimSdkPlugin.imManager = new IMManager();
FlutterOpenimSdkPlugin.userManager = new UserManager();
FlutterOpenimSdkPlugin.friendshipManager = new FriendshipManager();
FlutterOpenimSdkPlugin.messageManager = new MessageManager();
FlutterOpenimSdkPlugin.conversationManager = new ConversationManager();

View File

@@ -1,52 +0,0 @@
package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.OnFriendshipListener;
public class FriendshipListener implements OnFriendshipListener {
@Override
public void onBlackListAdd(String s) {
CommonUtil.emitEvent("friendListener", "onBlackListAdd", s);
}
@Override
public void onBlackListDeleted(String s) {
CommonUtil.emitEvent("friendListener", "onBlackListDeleted", s);
}
@Override
public void onFriendApplicationListAccept(String s) {
CommonUtil.emitEvent("friendListener", "onFriendApplicationListAccept", s);
}
@Override
public void onFriendApplicationListAdded(String s) {
CommonUtil.emitEvent("friendListener", "onFriendApplicationListAdded", s);
}
@Override
public void onFriendApplicationListDeleted(String s) {
CommonUtil.emitEvent("friendListener", "onFriendApplicationListDeleted", s);
}
@Override
public void onFriendApplicationListReject(String s) {
CommonUtil.emitEvent("friendListener", "onFriendApplicationListReject", s);
}
@Override
public void onFriendInfoChanged(String s) {
CommonUtil.emitEvent("friendListener", "onFriendInfoChanged", s);
}
@Override
public void onFriendListAdded(String s) {
CommonUtil.emitEvent("friendListener", "onFriendListAdded", s);
}
@Override
public void onFriendListDeleted(String s) {
CommonUtil.emitEvent("friendListener", "onFriendListDeleted", s);
}
}

View File

@@ -1,79 +0,0 @@
package io.openim.flutter_openim_sdk.listener;
import android.util.ArrayMap;
import java.util.HashMap;
import java.util.Map;
import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.OnGroupListener;
public class GroupListener implements OnGroupListener {
@Override
public void onApplicationProcessed(String s, String s1, int i, String s2) {
Map<String, Object> map = new ArrayMap<>();
map.put("groupId", s);
map.put("opUser", s1);
map.put("agreeOrReject", i);
map.put("opReason", s2);
CommonUtil.emitEvent("groupListener", "onApplicationProcessed", map);
}
@Override
public void onGroupCreated(String s) {
Map<String, Object> map = new ArrayMap<>();
map.put("groupId", s);
CommonUtil.emitEvent("groupListener", "onGroupCreated", map);
}
@Override
public void onGroupInfoChanged(String s, String s1) {
Map<String, Object> map = new ArrayMap<>();
map.put("groupId", s);
map.put("groupInfo", s1);
CommonUtil.emitEvent("groupListener", "onGroupInfoChanged", map);
}
@Override
public void onMemberEnter(String s, String s1) {
Map<String, Object> map = new ArrayMap<>();
map.put("groupId", s);
map.put("memberList", s1);
CommonUtil.emitEvent("groupListener", "onMemberEnter", map);
}
@Override
public void onMemberInvited(String s, String s1, String s2) {
Map<String, Object> map = new ArrayMap<>();
map.put("groupId", s);
map.put("opUser", s1);
map.put("memberList", s2);
CommonUtil.emitEvent("groupListener", "onMemberInvited", map);
}
@Override
public void onMemberKicked(String s, String s1, String s2) {
Map<String, Object> map = new ArrayMap<>();
map.put("groupId", s);
map.put("opUser", s1);
map.put("memberList", s2);
CommonUtil.emitEvent("groupListener", "onMemberKicked", map);
}
@Override
public void onMemberLeave(String s, String s1) {
Map<String, Object> map = new ArrayMap<>();
map.put("groupId", s);
map.put("member", s1);
CommonUtil.emitEvent("groupListener", "onMemberLeave", map);
}
@Override
public void onReceiveJoinApplication(String s, String s1, String s2) {
Map<String, Object> map = new ArrayMap<>();
map.put("groupId", s);
map.put("member", s1);
map.put("opReason", s2);
CommonUtil.emitEvent("groupListener", "onReceiveJoinApplication", map);
}
}

View File

@@ -5,13 +5,12 @@ import android.util.ArrayMap;
import java.util.Map;
import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.OnAdvancedMsgListener;
public class AdvancedMsgListener implements OnAdvancedMsgListener {
public class OnAdvancedMsgListener implements open_im_sdk_callback.OnAdvancedMsgListener {
// final Map<String, String> values = new HashMap<>();
private final String id;
public AdvancedMsgListener(String listenerId) {
public OnAdvancedMsgListener(String listenerId) {
this.id = listenerId;
// this.values.put("id", listenerId);
}

View File

@@ -1,28 +1,25 @@
package io.openim.flutter_openim_sdk.listener;
import io.flutter.Log;
import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.Base;
import open_im_sdk_callback.Base;
public class BaseListener implements Base {
public class OnBaseListener implements Base {
MethodChannel.Result result;
public BaseListener(MethodChannel.Result result) {
public OnBaseListener(MethodChannel.Result result) {
this.result = result;
}
@Override
public void onError(long l, String s) {
// Log.e("F-OpenIMSD(callback)", s);
public void onError(int l, String s) {
CommonUtil.runMainThreadReturnError(result, l, s, null);
}
@Override
public void onSuccess(String s) {
// Log.i("F-OpenIMSDK(callback)", s);
CommonUtil.runMainThreadReturn(result, s);
}
}

View File

@@ -0,0 +1,34 @@
package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
public class OnConnListener implements open_im_sdk_callback.OnConnListener {
@Override
public void onConnectFailed(int i, String s) {
CommonUtil.emitEvent("connectListener", "onConnectFailed", i, s, null);
}
@Override
public void onConnectSuccess() {
CommonUtil.emitEvent("connectListener", "onConnectSuccess", null);
}
@Override
public void onConnecting() {
CommonUtil.emitEvent("connectListener", "onConnecting", null);
}
@Override
public void onKickedOffline() {
CommonUtil.emitEvent("connectListener", "onKickedOffline", null);
}
@Override
public void onUserTokenExpired() {
CommonUtil.emitEvent("connectListener", "onUserTokenExpired", null);
}
}

View File

@@ -1,10 +1,9 @@
package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.OnConversationListener;
public class ConversationListener implements OnConversationListener {
public class OnConversationListener implements open_im_sdk_callback.OnConversationListener {
@Override
public void onConversationChanged(String s) {

View File

@@ -0,0 +1,76 @@
package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
/**
* 申请添加好友:
* 主动申请者收到OnFriendApplicationAdded
* 被添加者收到OnFriendApplicationAdded ok 111加222
* <p>
* 同意好友申请:
* 操作者收到 OnFriendApplicationAccepted OnFriendAdded
* 申请者收到OnFriendApplicationAccepted OnFriendAdded ok
* <p>
* 好友拒绝申请:
* 操作者收到OnFriendApplicationRejected
* 申请者收到OnFriendApplicationRejected ok
* <p>
* 删除好友:
* 操作者收到OnFriendDeleted ok
* <p>
* 修改备注:
* 操作者收到OnFriendInfoChanged ok
* <p>
* 添加黑名单:
* 操作者收到OnBlackAdded ok
* <p>
* 移除黑名单:
* 操作者收到OnBlackDeleted ok
*/
public class OnFriendshipListener implements open_im_sdk_callback.OnFriendshipListener {
@Override
public void onBlackAdded(String s) {
CommonUtil.emitEvent("friendListener", "onBlacklistAdded", s);
}
@Override
public void onBlackDeleted(String s) {
CommonUtil.emitEvent("friendListener", "onBlacklistDeleted", s);
}
@Override
public void onFriendAdded(String s) {
CommonUtil.emitEvent("friendListener", "onFriendAdded", s);
}
@Override
public void onFriendApplicationAccepted(String s) {
CommonUtil.emitEvent("friendListener", "onFriendApplicationAccepted", s);
}
@Override
public void onFriendApplicationAdded(String s) {
CommonUtil.emitEvent("friendListener", "onFriendApplicationAdded", s);
}
@Override
public void onFriendApplicationDeleted(String s) {
CommonUtil.emitEvent("friendListener", "onFriendApplicationDeleted", s);
}
@Override
public void onFriendApplicationRejected(String s) {
CommonUtil.emitEvent("friendListener", "onFriendApplicationRejected", s);
}
@Override
public void onFriendDeleted(String s) {
CommonUtil.emitEvent("friendListener", "onFriendDeleted", s);
}
@Override
public void onFriendInfoChanged(String s) {
CommonUtil.emitEvent("friendListener", "onFriendInfoChanged", s);
}
}

View File

@@ -0,0 +1,97 @@
package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
/**
* 创建群:
* 初始成员收到OnJoinedGroupAdded 验证ok 1111 创建 2222
* <p>
* 退出群:
* 退出者收到OnJoinedGroupDeleted
* 群成员收到OnGroupMemberDeleted 2222退出群 验证ok
* <p>
* 踢出群:
* 被踢者收到OnJoinedGroupDeleted
* 群成员收到OnGroupMemberDeleted 验证ok
* <p>
* 邀请进群:
* 被邀请者收到OnJoinedGroupAdded
* 群成员不包括被邀请者收到OnGroupMemberAdded 1111邀请2222 验证ok
* <p>
* 申请加群:
* 申请者收到OnGroupApplicationAdded
* 群主+管理员收到OnReceiveJoinGroupApplicationAdded 验证ok
* <p>
* 同意进群:
* 申请者收到OnJoinedGroupAdded OnGroupApplicationAccepted
* 群成员不包括申请者收到OnGroupMemberAdded
* 审批者群主或者管理员收到OnGroupMemberAdded OnGroupApplicationAccepted 验证ok
* <p>
* 拒绝进群:
* 申请者收到OnGroupApplicationRejected
* 审批者群主或者管理员收到OnGroupApplicationRejected 验证ok
* <p>
* 修改群资料: 群成员收到: OnGroupInfoChanged 验证ok
*/
public class OnGroupListener implements open_im_sdk_callback.OnGroupListener {
@Override
public void onGroupApplicationAccepted(String s) {
CommonUtil.emitEvent("groupListener", "onGroupApplicationAccepted", s);
}
@Override
public void onGroupApplicationAdded(String s) {
CommonUtil.emitEvent("groupListener", "onGroupApplicationAdded", s);
}
@Override
public void onGroupApplicationDeleted(String s) {
CommonUtil.emitEvent("groupListener", "onGroupApplicationDeleted", s);
}
@Override
public void onGroupApplicationRejected(String s) {
CommonUtil.emitEvent("groupListener", "onGroupApplicationRejected", s);
}
@Override
public void onGroupInfoChanged(String s) {
CommonUtil.emitEvent("groupListener", "onGroupInfoChanged", s);
}
@Override
public void onGroupMemberAdded(String s) {
CommonUtil.emitEvent("groupListener", "onGroupMemberAdded", s);
}
@Override
public void onGroupMemberDeleted(String s) {
CommonUtil.emitEvent("groupListener", "onGroupMemberDeleted", s);
}
@Override
public void onGroupMemberInfoChanged(String s) {
CommonUtil.emitEvent("groupListener", "onGroupMemberInfoChanged", s);
}
@Override
public void onJoinedGroupAdded(String s) {
CommonUtil.emitEvent("groupListener", "onJoinedGroupAdded", s);
}
@Override
public void onJoinedGroupDeleted(String s) {
CommonUtil.emitEvent("groupListener", "onJoinedGroupDeleted", s);
}
@Override
public void onReceiveJoinGroupApplicationAdded(String s) {
CommonUtil.emitEvent("groupListener", "onReceiveJoinGroupApplicationAdded", s);
}
@Override
public void onReceiveJoinGroupApplicationDeleted(String s) {
CommonUtil.emitEvent("groupListener", "onReceiveJoinGroupApplicationDeleted", s);
}
}

View File

@@ -7,14 +7,14 @@ import java.util.Map;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.SendMsgCallBack;
import open_im_sdk_callback.SendMsgCallBack;
public class MsgSendProgressListener implements SendMsgCallBack {
public class OnMsgSendListener implements SendMsgCallBack {
final private MethodChannel.Result result;
// final private MethodCall call;
final private Object clientMsgID;
public MsgSendProgressListener(MethodChannel.Result result, MethodCall call) {
public OnMsgSendListener(MethodChannel.Result result, MethodCall call) {
this.result = result;
// this.call = call;
Map<String, Object> args = call.argument("message");
@@ -22,7 +22,7 @@ public class MsgSendProgressListener implements SendMsgCallBack {
}
@Override
public void onError(long l, String s) {
public void onError(int l, String s) {
CommonUtil.runMainThreadReturnError(result, l, s, null);
}

View File

@@ -0,0 +1,14 @@
package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
public class OnUserListener implements open_im_sdk_callback.OnUserListener {
/**
* 登录用户个人资料有变化时回调
*/
@Override
public void onSelfInfoUpdated(String s) {
CommonUtil.emitEvent("userListener", "onSelfInfoUpdated", s);
}
}

View File

@@ -1,38 +0,0 @@
package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.IMSDKListener;
public class SDKListener implements IMSDKListener {
@Override
public void onConnectFailed(long l, String s) {
CommonUtil.emitEvent("initSDKListener", "onConnectFailed", l, s, null);
}
@Override
public void onConnectSuccess() {
CommonUtil.emitEvent("initSDKListener", "onConnectSuccess", null);
}
@Override
public void onConnecting() {
CommonUtil.emitEvent("initSDKListener", "onConnecting", null);
}
@Override
public void onKickedOffline() {
CommonUtil.emitEvent("initSDKListener", "onKickedOffline", null);
}
@Override
public void onSelfInfoUpdated(String s) {
CommonUtil.emitEvent("initSDKListener", "onSelfInfoUpdated", s);
}
@Override
public void onUserTokenExpired() {
CommonUtil.emitEvent("initSDKListener", "onUserTokenExpired", null);
}
}

View File

@@ -2,74 +2,98 @@ package io.openim.flutter_openim_sdk.manager;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.listener.BaseListener;
import io.openim.flutter_openim_sdk.listener.ConversationListener;
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
import io.openim.flutter_openim_sdk.listener.OnConversationListener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.Open_im_sdk;
public class ConversationManager extends BaseManager {
public void setConversationListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setConversationListener(new ConversationListener());
Open_im_sdk.setConversationListener(new OnConversationListener());
}
public void getAllConversationList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getAllConversationList(new BaseListener(result));
Open_im_sdk.getAllConversationList(
new OnBaseListener(result),
value(methodCall, "operationID")
);
}
public void getConversationListSplit(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getConversationListSplit(new BaseListener(result),
Open_im_sdk.getConversationListSplit(
new OnBaseListener(result),
value(methodCall, "operationID"),
int2long(methodCall, "offset"),
int2long(methodCall, "count"));
int2long(methodCall, "count")
);
}
public void getOneConversation(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getOneConversation(
value(methodCall, "sourceID"),
new OnBaseListener(result),
value(methodCall, "operationID"),
int2long(methodCall, "sessionType"),
new BaseListener(result));
value(methodCall, "sourceID")
);
}
public void getMultipleConversation(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getMultipleConversation(
jsonValue(methodCall, "conversationIDList"),
new BaseListener(result));
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall, "conversationIDList")
);
}
public void deleteConversation(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.deleteConversation(
value(methodCall, "conversationID"),
new BaseListener(result));
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "conversationID")
);
}
public void setConversationDraft(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setConversationDraft(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "conversationID"),
value(methodCall, "draftText"),
new BaseListener(result));
value(methodCall, "draftText")
);
}
public void pinConversation(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.pinConversation(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "conversationID"),
value(methodCall, "isPinned"),
new BaseListener(result));
value(methodCall, "isPinned")
);
}
public void markSingleMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.markSingleMessageHasRead(
new BaseListener(result),
value(methodCall, "userID"));
}
// public void markSingleMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.markSingleMessageHasRead(
// new OnBaseListener(result),
// value(methodCall, "operationID"),
// value(methodCall, "userID")
// );
// }
public void markGroupMessageHasRead(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.markGroupMessageHasRead(
new BaseListener(result),
value(methodCall, "groupID"));
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "groupID")
);
}
public void getTotalUnreadMsgCount(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getTotalUnreadMsgCount(new BaseListener(result));
Open_im_sdk.getTotalUnreadMsgCount(
new OnBaseListener(result),
value(methodCall, "operationID")
);
}
public void getConversationIDBySessionType(MethodCall methodCall, MethodChannel.Result result) {
@@ -80,7 +104,8 @@ public class ConversationManager extends BaseManager {
public void setConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setConversationRecvMessageOpt(
new BaseListener(result),
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall, "conversationIDList"),
int2long(methodCall, "status")
);
@@ -88,7 +113,8 @@ public class ConversationManager extends BaseManager {
public void getConversationRecvMessageOpt(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getConversationRecvMessageOpt(
new BaseListener(result),
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall, "conversationIDList")
);
}

View File

@@ -2,72 +2,115 @@ package io.openim.flutter_openim_sdk.manager;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.listener.BaseListener;
import io.openim.flutter_openim_sdk.listener.FriendshipListener;
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
import io.openim.flutter_openim_sdk.listener.OnFriendshipListener;
import open_im_sdk.Open_im_sdk;
public class FriendshipManager extends BaseManager {
public void setFriendListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setFriendListener(new FriendshipListener());
Open_im_sdk.setFriendListener(new OnFriendshipListener());
}
public void getFriendsInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getFriendsInfo(new BaseListener(result),
jsonValue(methodCall, "uidList"));
Open_im_sdk.getDesignatedFriendsInfo(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall, "uidList")
);
}
public void addFriend(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.addFriend(new BaseListener(result),
jsonValue(methodCall));
Open_im_sdk.addFriend(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
}
public void getFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getFriendApplicationList(new BaseListener(result));
public void getRecvFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getRecvFriendApplicationList(
new OnBaseListener(result),
value(methodCall, "operationID")
);
}
public void getSendFriendApplicationList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getSendFriendApplicationList(
new OnBaseListener(result),
value(methodCall, "operationID")
);
}
public void getFriendList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getFriendList(new BaseListener(result));
Open_im_sdk.getFriendList(
new OnBaseListener(result),
value(methodCall, "operationID")
);
}
public void setFriendInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setFriendInfo(
jsonValue(methodCall), new BaseListener(result));
public void setFriendRemark(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setFriendRemark(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
}
public void addToBlackList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.addToBlackList(new BaseListener(result),
jsonValue(methodCall, "uid"));
public void addBlacklist(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.addBlack(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "uid")
);
}
public void getBlackList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getBlackList(new BaseListener(result));
public void getBlacklist(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getBlackList(
new OnBaseListener(result),
value(methodCall, "operationID")
);
}
public void deleteFromBlackList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.deleteFromBlackList(new BaseListener(result),
jsonValue(methodCall, "uid"));
public void removeBlacklist(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.removeBlack(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "uid")
);
}
public void checkFriend(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.checkFriend(new BaseListener(result),
jsonValue(methodCall, "uidList"));
Open_im_sdk.checkFriend(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall, "uidList")
);
}
public void deleteFromFriendList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.deleteFromFriendList(
jsonValue(methodCall, "uid"), new BaseListener(result));
public void deleteFriend(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.deleteFriend(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "uid")
);
}
public void acceptFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.acceptFriendApplication(new BaseListener(result),
jsonValue(methodCall, "uid"));
Open_im_sdk.acceptFriendApplication(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
}
public void refuseFriendApplication(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.refuseFriendApplication(new BaseListener(result),
jsonValue(methodCall, "uid"));
Open_im_sdk.refuseFriendApplication(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
}
// public void forceSyncFriendApplication(MethodCall methodCall, MethodChannel.Result result) {

View File

@@ -2,104 +2,149 @@ package io.openim.flutter_openim_sdk.manager;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.listener.BaseListener;
import io.openim.flutter_openim_sdk.listener.GroupListener;
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
import io.openim.flutter_openim_sdk.listener.OnGroupListener;
import open_im_sdk.Open_im_sdk;
public class GroupManager extends BaseManager {
public void setGroupListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setGroupListener(new GroupListener());
Open_im_sdk.setGroupListener(new OnGroupListener());
}
public void inviteUserToGroup(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.inviteUserToGroup(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "gid"),
value(methodCall, "reason"),
jsonValue(methodCall, "uidList"),
new BaseListener(result));
jsonValue(methodCall, "uidList")
);
}
public void kickGroupMember(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.kickGroupMember(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "gid"),
value(methodCall, "reason"),
jsonValue(methodCall, "uidList"),
new BaseListener(result));
jsonValue(methodCall, "uidList")
);
}
public void getGroupMembersInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getGroupMembersInfo(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "gid"),
jsonValue(methodCall, "uidList"),
new BaseListener(result));
jsonValue(methodCall, "uidList")
);
}
public void getGroupMemberList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getGroupMemberList(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "gid"),
value(methodCall, "filter"),
value(methodCall, "next"),
new BaseListener(result));
value(methodCall, "offset"),
value(methodCall, "count")
);
}
public void getJoinedGroupList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getJoinedGroupList(new BaseListener(result));
Open_im_sdk.getJoinedGroupList(
new OnBaseListener(result),
value(methodCall, "operationID")
);
}
public void createGroup(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.createGroup(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall, "gInfo"),
jsonValue(methodCall, "memberList"),
new BaseListener(result));
jsonValue(methodCall, "memberList")
);
}
public void setGroupInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setGroupInfo(jsonValue(methodCall, "gInfo"), new BaseListener(result));
Open_im_sdk.setGroupInfo(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "gid"),
jsonValue(methodCall, "gInfo")
);
}
public void getGroupsInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getGroupsInfo(jsonValue(methodCall, "gidList"), new BaseListener(result));
Open_im_sdk.getGroupsInfo(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall, "gidList")
);
}
public void joinGroup(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.joinGroup(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "gid"),
value(methodCall, "reason"),
new BaseListener(result));
value(methodCall, "reason")
);
}
public void quitGroup(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.quitGroup(
value(methodCall, "gid"),
new BaseListener(result));
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "gid")
);
}
public void transferGroupOwner(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.transferGroupOwner(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "gid"),
value(methodCall, "uid"),
new BaseListener(result));
value(methodCall, "uid")
);
}
public void getGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getGroupApplicationList(new BaseListener(result));
public void getRecvGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getRecvGroupApplicationList(
new OnBaseListener(result),
value(methodCall, "operationID")
);
}
public void getSendGroupApplicationList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getSendGroupApplicationList(
new OnBaseListener(result),
value(methodCall, "operationID")
);
}
public void acceptGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.acceptGroupApplication(
jsonValue(methodCall, "application"),
value(methodCall, "reason"),
new BaseListener(result));
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "gid"),
value(methodCall, "uid"),
value(methodCall, "handleMsg")
);
}
public void refuseGroupApplication(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.refuseGroupApplication(
jsonValue(methodCall, "application"),
value(methodCall, "reason"),
new BaseListener(result));
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "gid"),
value(methodCall, "uid"),
value(methodCall, "handleMsg")
);
}

View File

@@ -2,8 +2,8 @@ package io.openim.flutter_openim_sdk.manager;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.listener.BaseListener;
import io.openim.flutter_openim_sdk.listener.SDKListener;
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
import io.openim.flutter_openim_sdk.listener.OnConnListener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.Open_im_sdk;
@@ -11,18 +11,27 @@ public class IMManager extends BaseManager {
public void initSDK(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, Open_im_sdk.initSDK(
jsonValue(methodCall), new SDKListener()));
new OnConnListener(),
value(methodCall, "operationID"),
jsonValue(methodCall))
);
// CommonUtil.runMainThreadReturn(result, null);
}
public void login(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.login(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "uid"),
value(methodCall, "token"), new BaseListener(result));
value(methodCall, "token")
);
}
public void logout(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.logout(new BaseListener(result));
Open_im_sdk.logout(
new OnBaseListener(result),
value(methodCall, "operationID")
);
}
public void getLoginStatus(MethodCall methodCall, MethodChannel.Result result) {
@@ -33,25 +42,25 @@ public class IMManager extends BaseManager {
// CommonUtil.runMainThreadReturn(result, Open_im_sdk.getLoginUid());
// }
public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getUsersInfo(
jsonValue(methodCall, "uidList"), new BaseListener(result));
}
// public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.getUsersInfo(
// jsonValue(methodCall, "uidList"), new BaseListener(result));
// }
public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setSelfInfo(
jsonValue(methodCall), new BaseListener(result));
}
// public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.setSelfInfo(
// jsonValue(methodCall), new BaseListener(result));
// }
public void forceSyncLoginUerInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.forceSyncLoginUerInfo();
}
// public void forceSyncLoginUerInfo(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.forceSyncLoginUerInfo();
// }
// public void forceReConn(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.forceReConn();
// }
public void setSdkLog(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setSdkLog(value(methodCall, "sdkLog"));
}
// public void setSdkLog(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.setSdkLog(value(methodCall, "sdkLog"));
// }
}

View File

@@ -1,28 +1,24 @@
package io.openim.flutter_openim_sdk.manager;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.listener.AdvancedMsgListener;
import io.openim.flutter_openim_sdk.listener.BaseListener;
import io.openim.flutter_openim_sdk.listener.MsgSendProgressListener;
import io.openim.flutter_openim_sdk.listener.OnAdvancedMsgListener;
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
import io.openim.flutter_openim_sdk.listener.OnMsgSendListener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.OnAdvancedMsgListener;
import open_im_sdk.Open_im_sdk;
public class MessageManager extends BaseManager {
private final static String KEY_ID = "id";
// private final static Map<String, OnAdvancedMsgListener> listeners = new HashMap<>();
private static boolean initializedListener = false;
/* private static boolean initializedListener = false;
private final static Map<String, AdvancedMsgListener> listeners = new ConcurrentHashMap<>();
// protected void clearListeners() {
// initializedListener = false;
// listeners.clear();
// }
protected void clearListeners() {
initializedListener = false;
listeners.clear();
}
private final static OnAdvancedMsgListener sdkMsgListener = new OnAdvancedMsgListener() {
@Override
@@ -50,21 +46,21 @@ public class MessageManager extends BaseManager {
public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
String key = methodCall.argument(KEY_ID);
Open_im_sdk.addAdvancedMsgListener(new AdvancedMsgListener(key));
// listeners.put(key, new AdvancedMsgListener(key));
// if (!initializedListener) {
// initializedListener = true;
// Open_im_sdk.addAdvancedMsgListener(sdkMsgListener);
// }
listeners.put(key, new AdvancedMsgListener(key));
if (!initializedListener) {
initializedListener = true;
Open_im_sdk.addAdvancedMsgListener(sdkMsgListener);
}
}
public void removeAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
// String key = methodCall.argument(KEY_ID);
// listeners.remove(key);
// if (listeners.isEmpty()) {
// initializedListener = false;
// Open_im_sdk.removeAdvancedMsgListener(sdkMsgListener);
// }
}
String key = methodCall.argument(KEY_ID);
listeners.remove(key);
if (listeners.isEmpty()) {
initializedListener = false;
Open_im_sdk.removeAdvancedMsgListener(sdkMsgListener);
}
}*/
/*
public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
@@ -83,63 +79,93 @@ public class MessageManager extends BaseManager {
}
*/
public void setAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
String key = methodCall.argument(KEY_ID);
Open_im_sdk.setAdvancedMsgListener(new OnAdvancedMsgListener(key));
}
public void sendMessage(MethodCall methodCall, MethodChannel.Result result) {
MsgSendProgressListener listener = new MsgSendProgressListener(result, methodCall);
Open_im_sdk.sendMessage(listener,
Open_im_sdk.sendMessage(
new OnMsgSendListener(result, methodCall),
value(methodCall, "operationID"),
jsonValue(methodCall, "message"),
value(methodCall, "userID"),
value(methodCall, "groupID"),
value(methodCall, "onlineUserOnly"));
jsonValue(methodCall, "offlinePushInfo")
);
}
public void getHistoryMessageList(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getHistoryMessageList(new BaseListener(result), jsonValue(methodCall));
Open_im_sdk.getHistoryMessageList(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
}
public void revokeMessage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.revokeMessage(new BaseListener(result), jsonValue(methodCall));
Open_im_sdk.revokeMessage(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
}
public void deleteMessageFromLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.deleteMessageFromLocalStorage(new BaseListener(result), jsonValue(methodCall));
Open_im_sdk.deleteMessageFromLocalStorage(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall)
);
}
public void deleteMessages(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.deleteMessages(new BaseListener(result), CommonUtil.getSDKJsonParam(methodCall));
}
// public void deleteMessages(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.deleteMessages(new OnBaseListener(result), CommonUtil.getSDKJsonParam(methodCall));
// }
public void insertSingleMessageToLocalStorage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.insertSingleMessageToLocalStorage(new BaseListener(result),
Open_im_sdk.insertSingleMessageToLocalStorage(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall, "message"),
value(methodCall, "receiverID"),
value(methodCall, "senderID"));
value(methodCall, "senderID")
);
}
public void findMessages(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.findMessages(new BaseListener(result), jsonValue(methodCall, "messageIDList"));
}
// public void findMessages(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.findMessages(new OnBaseListener(result), jsonValue(methodCall, "messageIDList"));
// }
public void markC2CMessageAsRead(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.markC2CMessageAsRead(new BaseListener(result),
Open_im_sdk.markC2CMessageAsRead(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "userID"),
jsonValue(methodCall, "messageIDList"));
jsonValue(methodCall, "messageIDList")
);
}
public void typingStatusUpdate(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.typingStatusUpdate(value(methodCall, "userID"),
value(methodCall, "typing"));
Open_im_sdk.typingStatusUpdate(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "userID"),
value(methodCall, "msgTip")
);
}
public void createTextMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createTextMessage(
value(methodCall, "operationID"),
value(methodCall, "text")));
}
public void createTextAtMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createTextAtMessage(
value(methodCall, "operationID"),
value(methodCall, "text"),
jsonValue(methodCall, "atUserList")));
}
@@ -147,17 +173,20 @@ public class MessageManager extends BaseManager {
public void createImageMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createImageMessage(
value(methodCall, "operationID"),
value(methodCall, "imagePath")));
}
public void createImageMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createImageMessageFromFullPath(
value(methodCall, "operationID"),
value(methodCall, "imagePath")));
}
public void createSoundMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createSoundMessage(
value(methodCall, "operationID"),
value(methodCall, "soundPath"),
int2long(methodCall, "duration")));
}
@@ -165,6 +194,7 @@ public class MessageManager extends BaseManager {
public void createSoundMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createSoundMessageFromFullPath(
value(methodCall, "operationID"),
value(methodCall, "soundPath"),
int2long(methodCall, "duration")));
}
@@ -172,6 +202,7 @@ public class MessageManager extends BaseManager {
public void createVideoMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createVideoMessage(
value(methodCall, "operationID"),
value(methodCall, "videoPath"),
value(methodCall, "videoType"),
int2long(methodCall, "duration"),
@@ -181,6 +212,7 @@ public class MessageManager extends BaseManager {
public void createVideoMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createVideoMessageFromFullPath(
value(methodCall, "operationID"),
value(methodCall, "videoPath"),
value(methodCall, "videoType"),
int2long(methodCall, "duration"),
@@ -190,6 +222,7 @@ public class MessageManager extends BaseManager {
public void createFileMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createFileMessage(
value(methodCall, "operationID"),
value(methodCall, "filePath"),
value(methodCall, "fileName")));
}
@@ -197,6 +230,7 @@ public class MessageManager extends BaseManager {
public void createFileMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createFileMessageFromFullPath(
value(methodCall, "operationID"),
value(methodCall, "filePath"),
value(methodCall, "fileName")));
}
@@ -204,6 +238,7 @@ public class MessageManager extends BaseManager {
public void createMergerMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createMergerMessage(
value(methodCall, "operationID"),
jsonValue(methodCall, "messageList"),
value(methodCall, "title"),
jsonValue(methodCall, "summaryList")));
@@ -213,11 +248,13 @@ public class MessageManager extends BaseManager {
public void createForwardMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createForwardMessage(
value(methodCall, "operationID"),
jsonValue(methodCall, "message")));
}
public void createLocationMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createLocationMessage(
value(methodCall, "operationID"),
value(methodCall, "description"),
value(methodCall, "longitude"),
value(methodCall, "latitude")
@@ -226,6 +263,7 @@ public class MessageManager extends BaseManager {
public void createCustomMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createCustomMessage(
value(methodCall, "operationID"),
value(methodCall, "data"),
value(methodCall, "extension"),
value(methodCall, "description")
@@ -234,6 +272,7 @@ public class MessageManager extends BaseManager {
public void createQuoteMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createQuoteMessage(
value(methodCall, "operationID"),
value(methodCall, "quoteText"),
jsonValue(methodCall, "quoteMessage")
));
@@ -241,21 +280,28 @@ public class MessageManager extends BaseManager {
public void createCardMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createCardMessage(
value(methodCall, "operationID"),
jsonValue(methodCall, "cardMessage")
));
}
public void forceSyncMsg(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.forceSyncMsg();
}
// public void forceSyncMsg(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.forceSyncMsg();
// }
public void clearC2CHistoryMessage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.clearC2CHistoryMessage(new BaseListener(result),
value(methodCall, "userID"));
Open_im_sdk.clearC2CHistoryMessage(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "userID")
);
}
public void clearGroupHistoryMessage(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.clearGroupHistoryMessage(new BaseListener(result),
value(methodCall, "groupID"));
Open_im_sdk.clearGroupHistoryMessage(
new OnBaseListener(result),
value(methodCall, "operationID"),
value(methodCall, "groupID")
);
}
}

View File

@@ -0,0 +1,35 @@
package io.openim.flutter_openim_sdk.manager;
import io.flutter.plugin.common.MethodCall;
import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
import io.openim.flutter_openim_sdk.listener.OnUserListener;
import open_im_sdk.Open_im_sdk;
public class UserManager extends BaseManager {
public void setUserListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setUserListener(new OnUserListener());
}
public void getUsersInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getUsersInfo(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall, "uidList"));
}
public void setSelfInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setSelfInfo(
new OnBaseListener(result),
value(methodCall, "operationID"),
jsonValue(methodCall));
}
public void getSelfUserInfo(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getSelfUserInfo(
new OnBaseListener(result),
value(methodCall, "operationID")
);
}
}

View File

@@ -32,7 +32,7 @@ public class CommonUtil {
runMainThreadReturnError(result, String.valueOf(errorCode), errorMessage, errorDetails);
}
public synchronized static <T> void emitEvent(String method, String type, Long errCode, String errMsg, T data) {
public synchronized static <T> void emitEvent(String method, String type, Object errCode, String errMsg, T data) {
runMainThread(() -> {
Map<String, Object> res = new ArrayMap<>();
if (null != type) {