Add some APIs.
This commit is contained in:
parent
4fef487562
commit
ceba9e827f
@ -322,6 +322,15 @@ public class MessageManager extends BaseManager {
|
|||||||
value(methodCall, "localEx")
|
value(methodCall, "localEx")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setAppBadge(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.setAppBadge(
|
||||||
|
new OnBaseListener(result, methodCall),
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
value(methodCall, "count")
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
public void sendMessageNotOss(MethodCall methodCall, MethodChannel.Result result) {
|
public void sendMessageNotOss(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.sendMessageNotOss(
|
Open_im_sdk.sendMessageNotOss(
|
||||||
new OnMsgSendListener(result, methodCall),
|
new OnMsgSendListener(result, methodCall),
|
||||||
|
@ -45,7 +45,8 @@ public class MessageManager: BaseServiceManager {
|
|||||||
|
|
||||||
self["findMessageList"] = findMessageList
|
self["findMessageList"] = findMessageList
|
||||||
self["setMessageLocalEx"] = setMessageLocalEx
|
self["setMessageLocalEx"] = setMessageLocalEx
|
||||||
|
self["setAppBadge"] = setAppBadge
|
||||||
|
|
||||||
self["sendMessageNotOss"] = sendMessageNotOss
|
self["sendMessageNotOss"] = sendMessageNotOss
|
||||||
self["createImageMessageByURL"] = createImageMessageByURL
|
self["createImageMessageByURL"] = createImageMessageByURL
|
||||||
self["createSoundMessageByURL"] = createSoundMessageByURL
|
self["createSoundMessageByURL"] = createSoundMessageByURL
|
||||||
@ -219,6 +220,10 @@ public class MessageManager: BaseServiceManager {
|
|||||||
func setMessageLocalEx(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func setMessageLocalEx(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkSetMessageLocalEx(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[string: "clientMsgID"], methodCall[string: "localEx"])
|
Open_im_sdkSetMessageLocalEx(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[string: "clientMsgID"], methodCall[string: "localEx"])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func setAppBadge(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkSetAppBadge(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[int64: "count"])
|
||||||
|
}
|
||||||
|
|
||||||
func sendMessageNotOss(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func sendMessageNotOss(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel,result: result,methodCall: methodCall)
|
let sendMsgProgressListener: SendMsgProgressListener = SendMsgProgressListener(channel: channel,result: result,methodCall: methodCall)
|
||||||
|
4
lib/src/enum/allow_type.dart
Normal file
4
lib/src/enum/allow_type.dart
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
class AllowType {
|
||||||
|
static const allow = 0;
|
||||||
|
static const notAllow = 1;
|
||||||
|
}
|
14
lib/src/enum/group_member_filter.dart
Normal file
14
lib/src/enum/group_member_filter.dart
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
/// Group Member Filter
|
||||||
|
class GroupMemberFilter {
|
||||||
|
static const all = 0;
|
||||||
|
|
||||||
|
static const owner = 1;
|
||||||
|
|
||||||
|
static const admin = 2;
|
||||||
|
|
||||||
|
static const member = 3;
|
||||||
|
|
||||||
|
static const adminAndMember = 4;
|
||||||
|
|
||||||
|
static const superAndAdmin = 4;
|
||||||
|
}
|
7
lib/src/enum/group_status.dart
Normal file
7
lib/src/enum/group_status.dart
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
/// Group Status
|
||||||
|
class GroupStatus {
|
||||||
|
static const normal = 0;
|
||||||
|
static const baned = 1;
|
||||||
|
static const dismissed = 2;
|
||||||
|
static const muted = 3;
|
||||||
|
}
|
5
lib/src/enum/join_source.dart
Normal file
5
lib/src/enum/join_source.dart
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class JoinSource {
|
||||||
|
static const invited = 2;
|
||||||
|
static const search = 3;
|
||||||
|
static const QRCode = 4;
|
||||||
|
}
|
5
lib/src/enum/receive_message_opt.dart
Normal file
5
lib/src/enum/receive_message_opt.dart
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
class ReceiveMessageOpt {
|
||||||
|
static const receive = 0;
|
||||||
|
static const notReceive = 1;
|
||||||
|
static const notNotify = 2;
|
||||||
|
}
|
4
lib/src/enum/relationship.dart
Normal file
4
lib/src/enum/relationship.dart
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
class AllowType {
|
||||||
|
static const black = 0;
|
||||||
|
static const friend = 1;
|
||||||
|
}
|
@ -33,8 +33,7 @@ class GroupManager {
|
|||||||
'reason': reason,
|
'reason': reason,
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
}))
|
}))
|
||||||
.then((value) =>
|
.then((value) => Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
|
||||||
Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
|
|
||||||
|
|
||||||
/// Remove group members
|
/// Remove group members
|
||||||
/// [groupID] Group ID
|
/// [groupID] Group ID
|
||||||
@ -55,8 +54,7 @@ class GroupManager {
|
|||||||
'reason': reason,
|
'reason': reason,
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
}))
|
}))
|
||||||
.then((value) =>
|
.then((value) => Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
|
||||||
Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
|
|
||||||
|
|
||||||
/// Query group member information
|
/// Query group member information
|
||||||
/// [groupID] Group ID
|
/// [groupID] Group ID
|
||||||
@ -74,8 +72,7 @@ class GroupManager {
|
|||||||
'userIDList': userIDList,
|
'userIDList': userIDList,
|
||||||
"operationID": Utils.checkOperationID(operationID),
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
}))
|
}))
|
||||||
.then((value) =>
|
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
|
||||||
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
|
|
||||||
|
|
||||||
/// Paginate and retrieve the group member list
|
/// Paginate and retrieve the group member list
|
||||||
/// [groupID] Group ID
|
/// [groupID] Group ID
|
||||||
@ -99,8 +96,7 @@ class GroupManager {
|
|||||||
'count': count,
|
'count': count,
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
}))
|
}))
|
||||||
.then((value) =>
|
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
|
||||||
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
|
|
||||||
|
|
||||||
/// Paginate and retrieve the group member list as a map
|
/// Paginate and retrieve the group member list as a map
|
||||||
/// [groupID] Group ID
|
/// [groupID] Group ID
|
||||||
@ -181,36 +177,17 @@ class GroupManager {
|
|||||||
'ownerUserID': ownerUserID,
|
'ownerUserID': ownerUserID,
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
}))
|
}))
|
||||||
.then(
|
.then((value) => Utils.toObj(value, (map) => GroupInfo.fromJson(map)));
|
||||||
(value) => Utils.toObj(value, (map) => GroupInfo.fromJson(map)));
|
|
||||||
|
|
||||||
/// Edit group information
|
/// Edit group information
|
||||||
Future<dynamic> setGroupInfo({
|
Future<dynamic> setGroupInfo(
|
||||||
required String groupID,
|
GroupInfo groupInfo, {
|
||||||
String? groupName,
|
|
||||||
String? notification,
|
|
||||||
String? introduction,
|
|
||||||
String? faceURL,
|
|
||||||
String? ex,
|
|
||||||
int? needVerification,
|
|
||||||
int? lookMemberInfo,
|
|
||||||
int? applyMemberFriend,
|
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) =>
|
||||||
_channel.invokeMethod(
|
_channel.invokeMethod(
|
||||||
'setGroupInfo',
|
'setGroupInfo',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
'groupInfo': {
|
'groupInfo': groupInfo.toJson(),
|
||||||
"groupID": groupID,
|
|
||||||
"groupName": groupName,
|
|
||||||
"notification": notification,
|
|
||||||
"introduction": introduction,
|
|
||||||
"faceURL": faceURL,
|
|
||||||
"ex": ex,
|
|
||||||
'needVerification': needVerification,
|
|
||||||
'lookMemberInfo': lookMemberInfo,
|
|
||||||
'applyMemberFriend': applyMemberFriend,
|
|
||||||
},
|
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
@ -226,8 +203,7 @@ class GroupManager {
|
|||||||
'groupIDList': groupIDList,
|
'groupIDList': groupIDList,
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
}))
|
}))
|
||||||
.then(
|
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
|
||||||
(value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
|
|
||||||
|
|
||||||
/// Apply to join a group, requiring approval from an administrator or the group.
|
/// Apply to join a group, requiring approval from an administrator or the group.
|
||||||
/// [joinSource] 2: Invited, 3: Searched, 4: Using a QR code
|
/// [joinSource] 2: Invited, 3: Searched, 4: Using a QR code
|
||||||
@ -275,28 +251,22 @@ class GroupManager {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
/// Handle group membership applications received as a group owner or administrator
|
/// Handle group membership applications received as a group owner or administrator
|
||||||
Future<List<GroupApplicationInfo>> getGroupApplicationListAsRecipient(
|
Future<List<GroupApplicationInfo>> getGroupApplicationListAsRecipient({String? operationID}) => _channel
|
||||||
{String? operationID}) =>
|
.invokeMethod(
|
||||||
_channel
|
'getGroupApplicationListAsRecipient',
|
||||||
.invokeMethod(
|
_buildParam({
|
||||||
'getGroupApplicationListAsRecipient',
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
_buildParam({
|
}))
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
.then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
|
||||||
}))
|
|
||||||
.then((value) =>
|
|
||||||
Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
|
|
||||||
|
|
||||||
/// Get the list of group membership applications sent by the user
|
/// Get the list of group membership applications sent by the user
|
||||||
Future<List<GroupApplicationInfo>> getGroupApplicationListAsApplicant(
|
Future<List<GroupApplicationInfo>> getGroupApplicationListAsApplicant({String? operationID}) => _channel
|
||||||
{String? operationID}) =>
|
.invokeMethod(
|
||||||
_channel
|
'getGroupApplicationListAsApplicant',
|
||||||
.invokeMethod(
|
_buildParam({
|
||||||
'getGroupApplicationListAsApplicant',
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
_buildParam({
|
}))
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
.then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
|
||||||
}))
|
|
||||||
.then((value) =>
|
|
||||||
Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
|
|
||||||
|
|
||||||
/// Accept a group membership application as an administrator or group owner
|
/// Accept a group membership application as an administrator or group owner
|
||||||
/// Note: Membership applications require approval from administrators or the group.
|
/// Note: Membership applications require approval from administrators or the group.
|
||||||
@ -422,8 +392,7 @@ class GroupManager {
|
|||||||
},
|
},
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
}))
|
}))
|
||||||
.then(
|
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
|
||||||
(value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
|
|
||||||
|
|
||||||
/// Set group member role
|
/// Set group member role
|
||||||
/// [groupID] Group ID
|
/// [groupID] Group ID
|
||||||
@ -451,7 +420,7 @@ class GroupManager {
|
|||||||
int count = 0,
|
int count = 0,
|
||||||
int joinTimeBegin = 0,
|
int joinTimeBegin = 0,
|
||||||
int joinTimeEnd = 0,
|
int joinTimeEnd = 0,
|
||||||
List<String> excludeUserIDList = const [],
|
List<String> filterUserIDList = const [],
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) =>
|
||||||
_channel
|
_channel
|
||||||
@ -463,11 +432,10 @@ class GroupManager {
|
|||||||
'count': count,
|
'count': count,
|
||||||
'joinTimeBegin': joinTimeBegin,
|
'joinTimeBegin': joinTimeBegin,
|
||||||
'joinTimeEnd': joinTimeEnd,
|
'joinTimeEnd': joinTimeEnd,
|
||||||
'excludeUserIDList': excludeUserIDList,
|
'excludeUserIDList': filterUserIDList,
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
}))
|
}))
|
||||||
.then((value) =>
|
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
|
||||||
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
|
|
||||||
|
|
||||||
/// Set group verification for joining
|
/// Set group verification for joining
|
||||||
/// [groupID] Group ID
|
/// [groupID] Group ID
|
||||||
@ -530,8 +498,7 @@ class GroupManager {
|
|||||||
'groupID': groupID,
|
'groupID': groupID,
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
}))
|
}))
|
||||||
.then((value) =>
|
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
|
||||||
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
|
|
||||||
|
|
||||||
/// Search for group members
|
/// Search for group members
|
||||||
/// [groupID] Group ID
|
/// [groupID] Group ID
|
||||||
@ -563,8 +530,7 @@ class GroupManager {
|
|||||||
},
|
},
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
}))
|
}))
|
||||||
.then((value) =>
|
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
|
||||||
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
|
|
||||||
|
|
||||||
/// Query a group
|
/// Query a group
|
||||||
/// [groupID] Group ID
|
/// [groupID] Group ID
|
||||||
@ -602,17 +568,13 @@ class GroupManager {
|
|||||||
Future<dynamic> setGroupMemberInfo({
|
Future<dynamic> setGroupMemberInfo({
|
||||||
required String groupID,
|
required String groupID,
|
||||||
required String userID,
|
required String userID,
|
||||||
String? ex,
|
required GroupMembersInfo groupMembersInfo,
|
||||||
String? operationID,
|
String? operationID,
|
||||||
}) =>
|
}) =>
|
||||||
_channel.invokeMethod(
|
_channel.invokeMethod(
|
||||||
'setGroupMemberInfo',
|
'setGroupMemberInfo',
|
||||||
_buildParam({
|
_buildParam({
|
||||||
'info': {
|
'info': groupMembersInfo.toJson(),
|
||||||
'groupID': groupID,
|
|
||||||
'userID': userID,
|
|
||||||
'ex': ex,
|
|
||||||
},
|
|
||||||
'operationID': Utils.checkOperationID(operationID),
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
}));
|
}));
|
||||||
static Map _buildParam(Map param) {
|
static Map _buildParam(Map param) {
|
||||||
|
@ -777,6 +777,17 @@ class MessageManager {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future setAppBadge(int count, {
|
||||||
|
String? operationID,
|
||||||
|
}) {
|
||||||
|
return _channel.invokeMethod(
|
||||||
|
'setAppBadge',
|
||||||
|
_buildParam({
|
||||||
|
'count': count,
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
static Map _buildParam(Map param) {
|
static Map _buildParam(Map param) {
|
||||||
param["ManagerName"] = "messageManager";
|
param["ManagerName"] = "messageManager";
|
||||||
return param;
|
return param;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user