new add map,file message

This commit is contained in:
hrxiang
2021-08-19 19:34:23 +08:00
parent a63fd8966a
commit ebbbf4661c
8 changed files with 223 additions and 26 deletions

View File

@@ -52,5 +52,5 @@ android {
}
dependencies {
// implementation 'io.openim:client:0.0.13@aar'
implementation 'io.openim:client-sdk:0.0.4@aar'
implementation 'io.openim:client-sdk:0.0.5@aar'
}

View File

@@ -11,7 +11,7 @@ public class IMManager {
public void initSDK(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.initSDK(CommonUtil.getSDKJsonParam(methodCall), new SDKListener());
CommonUtil.runMainThreadReturn(result, null);
// CommonUtil.runMainThreadReturn(result, null);
}
public void login(MethodCall methodCall, MethodChannel.Result result) {

View File

@@ -106,6 +106,12 @@ public class MessageManager {
CommonUtil.getImagePath(methodCall)));
}
public void createImageMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createImageMessageFromFullPath(
CommonUtil.getImagePath(methodCall)));
}
public void createSoundMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createSoundMessage(
@@ -113,6 +119,13 @@ public class MessageManager {
CommonUtil.getSoundDuration(methodCall)));
}
public void createSoundMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createSoundMessageFromFullPath(
CommonUtil.getSoundPath(methodCall),
CommonUtil.getSoundDuration(methodCall)));
}
public void createVideoMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createVideoMessage(
@@ -122,6 +135,15 @@ public class MessageManager {
CommonUtil.getVideoSnapshotPath(methodCall)));
}
public void createVideoMessageFromFullPath(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createVideoMessageFromFullPath(
CommonUtil.getVideoPath(methodCall),
CommonUtil.getVideoType(methodCall),
CommonUtil.getVideoDuration(methodCall),
CommonUtil.getVideoSnapshotPath(methodCall)));
}
public void createFileMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createFileMessage(
@@ -137,12 +159,29 @@ public class MessageManager {
CommonUtil.getSummaryList(methodCall)));
}
public void createForwardMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result,
Open_im_sdk.createForwardMessage(
CommonUtil.getForwardMessage(methodCall)));
}
public void createLocationMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createLocationMessage(
CommonUtil.getMessageDes(methodCall),
CommonUtil.getLocationLongitude(methodCall),
CommonUtil.getLocationLatitude(methodCall)
));
}
public void createCustomMessage(MethodCall methodCall, MethodChannel.Result result) {
CommonUtil.runMainThreadReturn(result, Open_im_sdk.createCustomMessage(
CommonUtil.getCustomMessageData(methodCall),
CommonUtil.getCustomMessageExt(methodCall),
CommonUtil.getMessageDes(methodCall)
));
}
public void getTotalUnreadMsgCount(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.getTotalUnreadMsgCount(new BaseListener(result));
}

View File

@@ -263,6 +263,27 @@ public class CommonUtil {
return getSDKJsonParam(methodCall, KEY_GROUP_APPLICATION_INFO);
}
public static double getLocationLatitude(MethodCall methodCall) {
return getParamValue(methodCall, KEY_LOCATION_MESSAGE_LA);
}
public static double getLocationLongitude(MethodCall methodCall) {
return getParamValue(methodCall, KEY_LOCATION_MESSAGE_LO);
}
public static String getMessageDes(MethodCall methodCall) {
return getParamValue(methodCall, KEY_MESSAGE_DES);
}
public static byte[] getCustomMessageData(MethodCall methodCall) {
return getParamValue(methodCall, KEY_CUSTOM_MESSAGE_DATA);
}
public static byte[] getCustomMessageExt(MethodCall methodCall) {
return getParamValue(methodCall, KEY_CUSTOM_MESSAGE_EXT);
}
//login
final static String KEY_UID = "uid";
final static String KEY_TOKEN = "token";
@@ -282,6 +303,11 @@ public class CommonUtil {
final static String KEY_MERGER_MESSAGE_TITLE = "title";
final static String KEY_SUMMARY_LIST = "summaryList";
final static String KEY_FORWARD_MESSAGE = "message";
final static String KEY_LOCATION_MESSAGE_LO = "longitude";
final static String KEY_LOCATION_MESSAGE_LA = "latitude";
final static String KEY_MESSAGE_DES = "description";
final static String KEY_CUSTOM_MESSAGE_DATA = "data";
final static String KEY_CUSTOM_MESSAGE_EXT = "extension";
//send message
final static String KEY_SEND_MESSAGE_CONTENT = "message";
final static String KEY_SEND_MESSAGE_CONTENT_CLIENT_ID = "clientMsgID";