Skip to content

Commit 0d5be61

Browse files
authored
Merge pull request #551 from easemob/dev_4.1.3
Dev 4.1.3
2 parents 909a18e + 64235ef commit 0d5be61

25 files changed

+127
-89
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
## 4.1.3
2+
3+
#### 新增
4+
5+
- 支持 安卓 14;
6+
- 新增 开启 荣耀推送开关 `EMOptions#enableHonorPush` 方法;
7+
8+
#### 修复
9+
10+
- 修复调用 `EMChatManager#getThreadConversation` 报错;
11+
- 修复 `EMMessage#chatThread` 方法报错;
12+
- 修复 `EMChatRoomEventHandler#onSpecificationChanged` 回调不执行。
13+
- 修复 `EMChatThreadManager#fetchChatThreadMembers` 崩溃。
14+
- 修复特殊场景下,安卓平台退出后再登录会丢失聊天室监听事件问题。
15+
- 修复修改消息后,离线用户上线后拉取历史消息,消息体中缺乏 from 属性的问题。
16+
117
## 4.1.0
218

319
#### 新增:

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,5 @@ tasks.withType(JavaCompile){
4848

4949
dependencies {
5050
api 'androidx.appcompat:appcompat:1.1.0'
51-
implementation 'io.hyphenate:hyphenate-chat:4.1.1'
51+
implementation 'io.hyphenate:hyphenate-chat:4.1.3'
5252
}

android/src/main/java/com/easemob/im_flutter_sdk/EMChatRoomManagerWrapper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ public void onSpecificationChanged(EMChatRoom room) {
850850
()-> {
851851
Map<String, Object> data = new HashMap<>();
852852
data.put("room", EMChatRoomHelper.toJson(room));
853-
data.put("type", "onSpecificationChanged");
853+
data.put("type", "onRoomSpecificationChanged");
854854
post(() -> channel.invokeMethod(EMSDKMethod.chatRoomChange, data));
855855
}
856856
);

android/src/main/java/com/easemob/im_flutter_sdk/EMHelper.java

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,9 @@ static EMOptions fromJson(JSONObject json, Context context) throws JSONException
119119
if (pushConfig.getBoolean("enableVivoPush")) {
120120
builder.enableVivoPush();
121121
}
122+
if(pushConfig.getBoolean("enableHonorPush")) {
123+
builder.enableHonorPush();
124+
}
122125
options.setPushConfig(builder.build());
123126
}
124127
return options;
@@ -456,7 +459,7 @@ static EMMessage fromJson(JSONObject json) throws JSONException {
456459
if (statusFromInt(json.getInt("status")) == EMMessage.Status.SUCCESS) {
457460
message.setUnread(!json.getBoolean("hasRead"));
458461
}
459-
message.setDeliverAcked(json.getBoolean("hasDeliverAck"));
462+
// message.setDeliverAcked(json.getBoolean("hasDeliverAck"));
460463
message.setIsNeedGroupAck(json.getBoolean("needGroupAck"));
461464
if (json.has("groupAckCount")) {
462465
message.setGroupAckCount(json.getInt("groupAckCount"));
@@ -916,7 +919,7 @@ static EMVideoMessageBody videoBodyFromJson(JSONObject json) throws JSONExceptio
916919
static Map<String, Object> videoBodyToJson(EMVideoMessageBody body) {
917920
Map<String, Object> data = getParentMap(body);
918921
data.put("localPath", body.getLocalUrl());
919-
data.put("thumbnailLocalPath", body.getLocalThumbUri());
922+
data.put("thumbnailLocalPath", body.getLocalThumb());
920923
data.put("duration", body.getDuration());
921924
data.put("thumbnailRemotePath", body.getThumbnailUrl());
922925
data.put("thumbnailSecret", body.getThumbnailSecret());
@@ -1405,23 +1408,28 @@ static Map<String, Object> toJson(EMChatThread thread) {
14051408
class EMChatThreadEventHelper {
14061409
static Map<String, Object> toJson(EMChatThreadEvent event) {
14071410
Map<String, Object> data = new HashMap<>();
1408-
switch (event.getType()) {
1409-
case UNKNOWN:
1410-
data.put("type", 0);
1411-
break;
1412-
case CREATE:
1413-
data.put("type", 1);
1414-
break;
1415-
case UPDATE:
1416-
data.put("type", 2);
1417-
break;
1418-
case DELETE:
1419-
data.put("type", 3);
1420-
break;
1421-
case UPDATE_MSG:
1422-
data.put("type", 4);
1423-
break;
1411+
if(event.getType() != null) {
1412+
switch (event.getType()) {
1413+
case UNKNOWN:
1414+
data.put("type", 0);
1415+
break;
1416+
case CREATE:
1417+
data.put("type", 1);
1418+
break;
1419+
case UPDATE:
1420+
data.put("type", 2);
1421+
break;
1422+
case DELETE:
1423+
data.put("type", 3);
1424+
break;
1425+
case UPDATE_MSG:
1426+
data.put("type", 4);
1427+
break;
1428+
}
1429+
}else {
1430+
data.put("type", 0);
14241431
}
1432+
14251433
data.put("from", event.getFrom());
14261434
if (event.getChatThread() != null) {
14271435
data.put("thread", EMChatThreadHelper.toJson(event.getChatThread()));

android/src/main/java/com/easemob/im_flutter_sdk/EMMessageWrapper.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,11 @@ private void getChatThread(JSONObject params, String channelName, MethodChannel.
7373
String msgId = params.getString("msgId");
7474
EMMessage msg = getMessageWithId(msgId);
7575
asyncRunnable(()->{
76-
if (msg == null) {
76+
if (msg != null) {
7777
onSuccess(result, channelName, msg.getChatThread() != null ? EMChatThreadHelper.toJson(msg.getChatThread()) : null);
78+
}else {
79+
onSuccess(result, channelName, null);
7880
}
79-
onSuccess(result, channelName, null);
8081
});
8182
}
8283

example/ios/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
PODS:
22
- Flutter (1.0.0)
3-
- HyphenateChat (4.0.3)
3+
- HyphenateChat (4.1.1)
44
- im_flutter_sdk (0.0.1):
55
- Flutter
6-
- HyphenateChat (= 4.0.3)
6+
- HyphenateChat (= 4.1.1)
77

88
DEPENDENCIES:
99
- Flutter (from `Flutter`)
@@ -21,8 +21,8 @@ EXTERNAL SOURCES:
2121

2222
SPEC CHECKSUMS:
2323
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
24-
HyphenateChat: 35826ebaa42ebac897b39e29a06f2215a060011a
25-
im_flutter_sdk: bbcfbe596ef4682c9518604e1cb319e967f6b163
24+
HyphenateChat: 95aa4abbad0e763f513acbe21ff9543f50b886cd
25+
im_flutter_sdk: 9242a0d080c2f4ade4a0247a21b034036320233e
2626

2727
PODFILE CHECKSUM: 7368163408c647b7eb699d0d788ba6718e18fb8d
2828

example/lib/main.dart

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
import 'package:flutter/material.dart';
22
import 'package:im_flutter_sdk/im_flutter_sdk.dart';
33

4-
var appKey = "easemob-demo#flutter";
4+
var appKey = "";
55

66
void main() async {
77
WidgetsFlutterBinding.ensureInitialized();
8+
assert(appKey.isNotEmpty, "appKey is empty");
89
EMOptions options =
910
EMOptions(appKey: appKey, autoLogin: false, debugModel: true);
1011
await EMClient.getInstance.init(options);
@@ -297,7 +298,7 @@ class _MyHomePageState extends State<MyHomePage> {
297298
content: _messageContent,
298299
);
299300

300-
EMClient.getInstance.chatManager.sendMessage(msg);
301+
await EMClient.getInstance.chatManager.sendMessage(msg);
301302
}
302303

303304
void _addLogToConsole(String log) {

example/pubspec.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ packages:
9797
path: ".."
9898
relative: true
9999
source: path
100-
version: "4.0.3"
100+
version: "4.1.3"
101101
js:
102102
dependency: transitive
103103
description:

ios/Classes/EMChatManagerWrapper.m

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,4 +1247,8 @@ - (void)onMessageContentChanged:(EMChatMessage *)message operatorId:(NSString *)
12471247
arguments:dict];
12481248
}
12491249

1250+
- (void)messageAttachmentStatusDidChange:(EMChatMessage *)aMessage error:(EMError *)aError {
1251+
1252+
}
1253+
12501254
@end

ios/Classes/EMChatMessageWrapper.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ - (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
3333
} else if([ChatGroupAckCount isEqualToString:call.method]) {
3434
[self getGroupAckCount:call.arguments channelName:call.method result:result];
3535
} else if([ChatThread isEqualToString:call.method]) {
36-
36+
[self getChatThread:call.arguments channelName:call.method result:result];
3737
}
3838
else {
3939
[super handleMethodCall:call result:result];

0 commit comments

Comments
 (0)