增加方法
This commit is contained in:
parent
50bf41df51
commit
9998f9b99c
@ -388,6 +388,16 @@ public class MessageManager extends BaseManager {
|
|||||||
jsonValue(methodCall, "fileElem")));
|
jsonValue(methodCall, "fileElem")));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void FetchSurroundingMessages(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
CommonUtil.runMainThreadReturn(result,
|
||||||
|
Open_im_sdk.createFileMessageByURL(
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
jsonValue(methodCall, "message"),
|
||||||
|
int2long(methodCall, "before"),
|
||||||
|
int2long(methodCall, "after")));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public void setCustomBusinessListener(MethodCall methodCall, MethodChannel.Result result) {
|
public void setCustomBusinessListener(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.setCustomBusinessListener(new OnCustomBusinessListener());
|
Open_im_sdk.setCustomBusinessListener(new OnCustomBusinessListener());
|
||||||
|
|
||||||
|
@ -48,6 +48,10 @@ public class MessageManager: BaseServiceManager {
|
|||||||
self["setMessageLocalEx"] = setMessageLocalEx
|
self["setMessageLocalEx"] = setMessageLocalEx
|
||||||
self["setAppBadge"] = setAppBadge
|
self["setAppBadge"] = setAppBadge
|
||||||
|
|
||||||
|
self["fetchSurroundingMessages"] = fetchSurroundingMessages
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
self["sendMessageNotOss"] = sendMessageNotOss
|
self["sendMessageNotOss"] = sendMessageNotOss
|
||||||
self["createImageMessageByURL"] = createImageMessageByURL
|
self["createImageMessageByURL"] = createImageMessageByURL
|
||||||
self["createSoundMessageByURL"] = createSoundMessageByURL
|
self["createSoundMessageByURL"] = createSoundMessageByURL
|
||||||
@ -255,6 +259,13 @@ public class MessageManager: BaseServiceManager {
|
|||||||
Open_im_sdkSetCustomBusinessListener(CustomBusinessListener(channel: channel))
|
Open_im_sdkSetCustomBusinessListener(CustomBusinessListener(channel: channel))
|
||||||
callBack(result)
|
callBack(result)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func fetchSurroundingMessages(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
callBack(result, Open_im_sdkFetchSurroundingMessages(methodCall[string: "operationID"], methodCall[jsonString: "message"], methodCall[int: "before"], methodCall[int: "after"]))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SendMsgProgressListener: NSObject, Open_im_sdk_callbackSendMsgCallBackProtocol {
|
public class SendMsgProgressListener: NSObject, Open_im_sdk_callbackSendMsgCallBackProtocol {
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#
|
#
|
||||||
Pod::Spec.new do |s|
|
Pod::Spec.new do |s|
|
||||||
s.name = 'flutter_openim_sdk'
|
s.name = 'flutter_openim_sdk'
|
||||||
s.version = '0.0.6'
|
s.version = '0.0.7'
|
||||||
s.summary = 'A new Flutter project.'
|
s.summary = 'A new Flutter project.'
|
||||||
s.description = <<-DESC
|
s.description = <<-DESC
|
||||||
A new Flutter project.
|
A new Flutter project.
|
||||||
|
@ -816,6 +816,31 @@ class MessageManager {
|
|||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Fetch Surrounding Messages
|
||||||
|
/// [message] Message content
|
||||||
|
/// [before] message index - before
|
||||||
|
/// [after] message index - after
|
||||||
|
/// [operationID] Operation ID
|
||||||
|
Future<List<Message>> FetchSurroundingMessages({
|
||||||
|
required Message message,
|
||||||
|
int? before,
|
||||||
|
int? after,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel
|
||||||
|
.invokeMethod(
|
||||||
|
'fetchSurroundingMessages',
|
||||||
|
_buildParam({
|
||||||
|
'message': message.toJson(),
|
||||||
|
'before': before ?? 0,
|
||||||
|
'after': after ?? 0,
|
||||||
|
'operationID': Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) {
|
||||||
|
final result = Utils.toListMap(value);
|
||||||
|
return List<Message>.from(result);
|
||||||
|
});
|
||||||
|
|
||||||
static Map _buildParam(Map<String, dynamic> param) {
|
static Map _buildParam(Map<String, dynamic> param) {
|
||||||
param["ManagerName"] = "messageManager";
|
param["ManagerName"] = "messageManager";
|
||||||
param = Utils.cleanMap(param);
|
param = Utils.cleanMap(param);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user