Add custom emoji message
This commit is contained in:
parent
80152e2314
commit
6c0676fbe5
@ -41,5 +41,5 @@ android {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'io.openim:client-sdk:2.0.5@aar'
|
implementation 'io.openim:client-sdk:2.0.8@aar'
|
||||||
}
|
}
|
@ -285,6 +285,13 @@ public class MessageManager extends BaseManager {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void createFaceMessage(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createFaceMessage(
|
||||||
|
value(methodCall, "operationID"),
|
||||||
|
int2long(methodCall, "index"),
|
||||||
|
value(methodCall, "data")
|
||||||
|
));
|
||||||
|
}
|
||||||
// public void forceSyncMsg(MethodCall methodCall, MethodChannel.Result result) {
|
// public void forceSyncMsg(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
// Open_im_sdk.forceSyncMsg();
|
// Open_im_sdk.forceSyncMsg();
|
||||||
// }
|
// }
|
||||||
|
@ -33,6 +33,7 @@ public class MessageManager: BaseServiceManager {
|
|||||||
self["createCustomMessage"] = createCustomMessage
|
self["createCustomMessage"] = createCustomMessage
|
||||||
self["createQuoteMessage"] = createQuoteMessage
|
self["createQuoteMessage"] = createQuoteMessage
|
||||||
self["createCardMessage"] = createCardMessage
|
self["createCardMessage"] = createCardMessage
|
||||||
|
self["createFaceMessage"] = createFaceMessage
|
||||||
// self["forceSyncMsg"] = forceSyncMsg
|
// self["forceSyncMsg"] = forceSyncMsg
|
||||||
self["clearC2CHistoryMessage"] = clearC2CHistoryMessage
|
self["clearC2CHistoryMessage"] = clearC2CHistoryMessage
|
||||||
self["clearGroupHistoryMessage"] = clearGroupHistoryMessage
|
self["clearGroupHistoryMessage"] = clearGroupHistoryMessage
|
||||||
@ -116,7 +117,7 @@ public class MessageManager: BaseServiceManager {
|
|||||||
|
|
||||||
func createVideoMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func createVideoMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
let prama = Open_im_sdkCreateVideoMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "videoPath"], methodCall[string: "videoType"],
|
let prama = Open_im_sdkCreateVideoMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "videoPath"], methodCall[string: "videoType"],
|
||||||
methodCall[int64: "duration"], methodCall[string: "snapshotPath"])
|
methodCall[int64: "duration"], methodCall[string: "snapshotPath"])
|
||||||
callBack(result, prama)
|
callBack(result, prama)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -124,9 +125,9 @@ public class MessageManager: BaseServiceManager {
|
|||||||
callBack(result, Open_im_sdkCreateFileMessage(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"]))
|
callBack(result, Open_im_sdkCreateFileMessage(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"]))
|
||||||
}
|
}
|
||||||
|
|
||||||
func createFileMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func createFileMessageFromFullPath(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
callBack(result, Open_im_sdkCreateFileMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"]))
|
callBack(result, Open_im_sdkCreateFileMessageFromFullPath(methodCall[string: "operationID"], methodCall[string: "filePath"], methodCall[string: "fileName"]))
|
||||||
}
|
}
|
||||||
|
|
||||||
func createMergerMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func createMergerMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
let prama = Open_im_sdkCreateMergerMessage(methodCall[string: "operationID"], methodCall[jsonString: "messageList"], methodCall[string: "title"],
|
let prama = Open_im_sdkCreateMergerMessage(methodCall[string: "operationID"], methodCall[jsonString: "messageList"], methodCall[string: "title"],
|
||||||
@ -159,6 +160,9 @@ public class MessageManager: BaseServiceManager {
|
|||||||
callBack(result, Open_im_sdkCreateCardMessage(methodCall[string: "operationID"], methodCall[jsonString: "cardMessage"]))
|
callBack(result, Open_im_sdkCreateCardMessage(methodCall[string: "operationID"], methodCall[jsonString: "cardMessage"]))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func createFaceMessage(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
callBack(result, Open_im_sdkCreateFaceMessage(methodCall[string: "operationID"], methodCall[int: "index"], methodCall[string: "data"]))
|
||||||
|
}
|
||||||
// func forceSyncMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
// func forceSyncMsg(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
// Open_im_sdkForceSyncMsg()
|
// Open_im_sdkForceSyncMsg()
|
||||||
// callBack(result)
|
// callBack(result)
|
||||||
|
@ -29,6 +29,9 @@ FOUNDATION_EXPORT void Open_im_sdkAddFriend(id<Open_im_sdk_callbackBase> _Nullab
|
|||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
|
FOUNDATION_EXPORT void Open_im_sdkCheckFriend(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userIDList);
|
||||||
|
|
||||||
|
// skipped function CheckResourceLoad with unsupported parameter or return types
|
||||||
|
|
||||||
|
|
||||||
FOUNDATION_EXPORT BOOL Open_im_sdkCheckToken(NSString* _Nullable userID, NSString* _Nullable token, NSError* _Nullable* _Nullable error);
|
FOUNDATION_EXPORT BOOL Open_im_sdkCheckToken(NSString* _Nullable userID, NSString* _Nullable token, NSError* _Nullable* _Nullable error);
|
||||||
|
|
||||||
FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID);
|
FOUNDATION_EXPORT void Open_im_sdkClearC2CHistoryMessage(id<Open_im_sdk_callbackBase> _Nullable callback, NSString* _Nullable operationID, NSString* _Nullable userID);
|
||||||
@ -39,6 +42,8 @@ FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCardMessage(NSString* _Nul
|
|||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable operationID, NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description);
|
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateCustomMessage(NSString* _Nullable operationID, NSString* _Nullable data, NSString* _Nullable extension, NSString* _Nullable description);
|
||||||
|
|
||||||
|
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFaceMessage(NSString* _Nullable operationID, long index, NSString* _Nullable data);
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable fileName);
|
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessage(NSString* _Nullable operationID, NSString* _Nullable filePath, NSString* _Nullable fileName);
|
||||||
|
|
||||||
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable operationID, NSString* _Nullable fileBaseInfo);
|
FOUNDATION_EXPORT NSString* _Nonnull Open_im_sdkCreateFileMessageByURL(NSString* _Nullable operationID, NSString* _Nullable fileBaseInfo);
|
||||||
|
Binary file not shown.
@ -7,6 +7,7 @@ class MessageType {
|
|||||||
static const file = 105;
|
static const file = 105;
|
||||||
static const at_text = 106;
|
static const at_text = 106;
|
||||||
static const merger = 107;
|
static const merger = 107;
|
||||||
|
|
||||||
// static const forward = 108;
|
// static const forward = 108;
|
||||||
static const card = 108;
|
static const card = 108;
|
||||||
static const location = 109;
|
static const location = 109;
|
||||||
@ -15,6 +16,7 @@ class MessageType {
|
|||||||
static const has_read_receipt = 112;
|
static const has_read_receipt = 112;
|
||||||
static const typing = 113;
|
static const typing = 113;
|
||||||
static const quote = 114;
|
static const quote = 114;
|
||||||
|
static const custom_face = 115;
|
||||||
|
|
||||||
///
|
///
|
||||||
static const accept_friend = 201;
|
static const accept_friend = 201;
|
||||||
|
@ -444,6 +444,25 @@ class MessageManager {
|
|||||||
}))
|
}))
|
||||||
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||||
|
|
||||||
|
/// Create custom emoji message
|
||||||
|
/// 创建自定义表情消息
|
||||||
|
/// [index] The position of the emoji, such as the position emoji(表情的位置,如位置表情)
|
||||||
|
/// [data] Other data, such as url expressions(其他数据,如url表情)
|
||||||
|
Future<Message> createFaceMessage({
|
||||||
|
int index = -1,
|
||||||
|
String? data,
|
||||||
|
String? operationID,
|
||||||
|
}) =>
|
||||||
|
_channel
|
||||||
|
.invokeMethod(
|
||||||
|
'createFaceMessage',
|
||||||
|
_buildParam({
|
||||||
|
'index': index,
|
||||||
|
'data': data,
|
||||||
|
"operationID": Utils.checkOperationID(operationID),
|
||||||
|
}))
|
||||||
|
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
|
||||||
|
|
||||||
/// Clear all c2c history message
|
/// Clear all c2c history message
|
||||||
/// 清空单聊消息记录
|
/// 清空单聊消息记录
|
||||||
Future<dynamic> clearC2CHistoryMessage({
|
Future<dynamic> clearC2CHistoryMessage({
|
||||||
|
@ -36,6 +36,7 @@ class Message {
|
|||||||
QuoteElem? quoteElem;
|
QuoteElem? quoteElem;
|
||||||
MergeElem? mergeElem;
|
MergeElem? mergeElem;
|
||||||
NotificationElem? notificationElem;
|
NotificationElem? notificationElem;
|
||||||
|
FaceElem? faceElem;
|
||||||
|
|
||||||
Message({
|
Message({
|
||||||
this.clientMsgID,
|
this.clientMsgID,
|
||||||
@ -69,6 +70,7 @@ class Message {
|
|||||||
this.quoteElem,
|
this.quoteElem,
|
||||||
this.mergeElem,
|
this.mergeElem,
|
||||||
this.notificationElem,
|
this.notificationElem,
|
||||||
|
this.faceElem,
|
||||||
});
|
});
|
||||||
|
|
||||||
Message.fromJson(Map<String, dynamic> json) {
|
Message.fromJson(Map<String, dynamic> json) {
|
||||||
@ -123,6 +125,8 @@ class Message {
|
|||||||
notificationElem = json['notificationElem'] != null
|
notificationElem = json['notificationElem'] != null
|
||||||
? NotificationElem.fromJson(json['notificationElem'])
|
? NotificationElem.fromJson(json['notificationElem'])
|
||||||
: null;
|
: null;
|
||||||
|
faceElem =
|
||||||
|
json['faceElem'] != null ? FaceElem.fromJson(json['faceElem']) : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
@ -158,6 +162,7 @@ class Message {
|
|||||||
data['quoteElem'] = this.quoteElem?.toJson();
|
data['quoteElem'] = this.quoteElem?.toJson();
|
||||||
data['mergeElem'] = this.mergeElem?.toJson();
|
data['mergeElem'] = this.mergeElem?.toJson();
|
||||||
data['notificationElem'] = this.notificationElem?.toJson();
|
data['notificationElem'] = this.notificationElem?.toJson();
|
||||||
|
data['faceElem'] = this.faceElem?.toJson();
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -172,8 +177,7 @@ class Message {
|
|||||||
int get hashCode => clientMsgID.hashCode;
|
int get hashCode => clientMsgID.hashCode;
|
||||||
|
|
||||||
void update(Message message) {
|
void update(Message message) {
|
||||||
if (clientMsgID != message.clientMsgID) return;
|
if (this != message) return;
|
||||||
// clientMsgID = message.clientMsgID;
|
|
||||||
serverMsgID = message.serverMsgID;
|
serverMsgID = message.serverMsgID;
|
||||||
createTime = message.createTime;
|
createTime = message.createTime;
|
||||||
sendTime = message.sendTime;
|
sendTime = message.sendTime;
|
||||||
@ -204,6 +208,7 @@ class Message {
|
|||||||
quoteElem = message.quoteElem;
|
quoteElem = message.quoteElem;
|
||||||
mergeElem = message.mergeElem;
|
mergeElem = message.mergeElem;
|
||||||
notificationElem = message.notificationElem;
|
notificationElem = message.notificationElem;
|
||||||
|
faceElem = message.faceElem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -548,6 +553,25 @@ class NotificationElem {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class FaceElem {
|
||||||
|
int? index;
|
||||||
|
String? data;
|
||||||
|
|
||||||
|
FaceElem({this.index, this.data});
|
||||||
|
|
||||||
|
FaceElem.fromJson(Map<String, dynamic> json) {
|
||||||
|
index = json['index'];
|
||||||
|
data = json['data'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
data['index'] = this.index;
|
||||||
|
data['data'] = this.data;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class ReadReceiptInfo {
|
class ReadReceiptInfo {
|
||||||
String? uid;
|
String? uid;
|
||||||
List<String>? msgIDList;
|
List<String>? msgIDList;
|
||||||
|
@ -16,11 +16,17 @@ class UserInfo {
|
|||||||
int? createTime;
|
int? createTime;
|
||||||
String? remark;
|
String? remark;
|
||||||
|
|
||||||
|
/// User's public profile(用户公开的资料)
|
||||||
PublicUserInfo? publicInfo;
|
PublicUserInfo? publicInfo;
|
||||||
|
|
||||||
|
/// Only friends can view information(好友才能查看的资料)
|
||||||
FriendInfo? friendInfo;
|
FriendInfo? friendInfo;
|
||||||
|
|
||||||
|
/// blacklist information(黑名单资料)
|
||||||
BlacklistInfo? blackInfo;
|
BlacklistInfo? blackInfo;
|
||||||
|
|
||||||
bool? isFriendship;
|
bool? isFriendship;
|
||||||
|
|
||||||
bool? isBlacklist;
|
bool? isBlacklist;
|
||||||
|
|
||||||
UserInfo({
|
UserInfo({
|
||||||
@ -76,7 +82,7 @@ class UserInfo {
|
|||||||
birth = json['birth'] ?? _birth;
|
birth = json['birth'] ?? _birth;
|
||||||
email = json['email'] ?? _email;
|
email = json['email'] ?? _email;
|
||||||
remark = json['remark'] ?? _remark;
|
remark = json['remark'] ?? _remark;
|
||||||
ex = json['ex'];
|
ex = json['ex'] ?? _ex;
|
||||||
createTime = json['createTime'];
|
createTime = json['createTime'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,6 +129,10 @@ class UserInfo {
|
|||||||
? friendInfo?.gender
|
? friendInfo?.gender
|
||||||
: (isBlacklist! ? blackInfo?.gender : publicInfo?.gender);
|
: (isBlacklist! ? blackInfo?.gender : publicInfo?.gender);
|
||||||
|
|
||||||
|
String? get _ex => isFriendship!
|
||||||
|
? friendInfo?.ex
|
||||||
|
: (isBlacklist! ? blackInfo?.ex : publicInfo?.ex);
|
||||||
|
|
||||||
String? get _phoneNumber => friendInfo?.phoneNumber;
|
String? get _phoneNumber => friendInfo?.phoneNumber;
|
||||||
|
|
||||||
int? get _birth => friendInfo?.birth;
|
int? get _birth => friendInfo?.birth;
|
||||||
@ -131,9 +141,9 @@ class UserInfo {
|
|||||||
|
|
||||||
String? get _remark => friendInfo?.remark;
|
String? get _remark => friendInfo?.remark;
|
||||||
|
|
||||||
String getShowName() => _trimBlank(remark) ?? _trimBlank(nickname) ?? userID!;
|
String getShowName() => _isNull(remark) ?? _isNull(nickname) ?? userID!;
|
||||||
|
|
||||||
static String? _trimBlank(String? value) {
|
static String? _isNull(String? value) {
|
||||||
if (value == null || value.trim().isEmpty) return null;
|
if (value == null || value.trim().isEmpty) return null;
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
@ -145,6 +155,7 @@ class PublicUserInfo {
|
|||||||
String? faceURL;
|
String? faceURL;
|
||||||
int? gender;
|
int? gender;
|
||||||
int? appMangerLevel;
|
int? appMangerLevel;
|
||||||
|
String? ex;
|
||||||
|
|
||||||
PublicUserInfo({
|
PublicUserInfo({
|
||||||
this.userID,
|
this.userID,
|
||||||
@ -152,6 +163,7 @@ class PublicUserInfo {
|
|||||||
this.faceURL,
|
this.faceURL,
|
||||||
this.gender,
|
this.gender,
|
||||||
this.appMangerLevel,
|
this.appMangerLevel,
|
||||||
|
this.ex,
|
||||||
});
|
});
|
||||||
|
|
||||||
PublicUserInfo.fromJson(Map<String, dynamic> json) {
|
PublicUserInfo.fromJson(Map<String, dynamic> json) {
|
||||||
@ -160,6 +172,7 @@ class PublicUserInfo {
|
|||||||
faceURL = json['faceURL'];
|
faceURL = json['faceURL'];
|
||||||
gender = json['gender'];
|
gender = json['gender'];
|
||||||
appMangerLevel = json['appMangerLevel'];
|
appMangerLevel = json['appMangerLevel'];
|
||||||
|
ex = json['ex'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
@ -169,6 +182,7 @@ class PublicUserInfo {
|
|||||||
data['faceURL'] = this.faceURL;
|
data['faceURL'] = this.faceURL;
|
||||||
data['gender'] = this.gender;
|
data['gender'] = this.gender;
|
||||||
data['appMangerLevel'] = this.appMangerLevel;
|
data['appMangerLevel'] = this.appMangerLevel;
|
||||||
|
data['ex'] = this.ex;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user