Skip to content

Commit b0d8dc7

Browse files
authored
Merge pull request #482 from easemob/dev_3.8.3+4
Dev 3.8.3+4
2 parents d3aefe1 + 12baac9 commit b0d8dc7

File tree

23 files changed

+228
-137
lines changed

23 files changed

+228
-137
lines changed

CHANGELOG.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,17 @@
11
## NEXT
22

3-
* 支持gcm推送点击
3+
## 3.8.3+4
4+
* 修复消息attribute类型变为bool类型;
5+
* 修复群组免打扰属性不准;
6+
* 修复ios importMessages方法bug;
7+
* 修复群、聊天室禁言时不执行回调的bug;
8+
* 修复下载方法不执行callback;
9+
* 构造文件消息提供设置文件大小属性;
10+
* 修改`EMGroupChangeListener``EMGroupEventListener`
411

512
## 3.8.3+3
6-
* 修复安卓下resendMessage方法发送失败时不回调onError。
13+
* 修复安卓下resendMessage方法发送失败时不回调onError;
14+
* 修复fetchChatRoomMembers返回类型错误;
715

816
## 3.8.3+2
917
* 增加群组已读回执;

README.md

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Demo中使用的音视频是针对声网音视频封装的[EaseCallKit](https://
2828
1. 修改 `pubspec.yaml`;
2929
```dart
3030
dependencies:
31-
im_flutter_sdk: ^3.8.3+3
31+
im_flutter_sdk: ^3.8.3+4
3232
```
3333

3434
2. 执行`flutter pub get`;
@@ -1656,25 +1656,18 @@ try{
16561656
#### 更新自己的用户属性
16571657
```dart
16581658
try {
1659-
1660-
Map aMap = {'nickName': 'gagaga', 'mail': '[email protected]'};
1661-
EMUserInfo updateUserInfo =
1662-
await EMClient.getInstance.userInfoManager.updateOwnUserInfo(aMap);
1663-
} on EMError catch (e) {
1664-
print('操作失败,原因是: $e');
1665-
}
1666-
```
1667-
#### 更新自己的某一个用户属性
1668-
```dart
1669-
try {
1670-
EMUserInfoType infoType = EMUserInfoType.EMUserInfoTypeBirth;
1671-
String updateValue = '2021.01.01';
1672-
EMUserInfo updateUserInfo = await EMClient.getInstance.userInfoManager
1673-
.updateOwnUserInfoWithType(infoType, updateValue);
1659+
EMUserInfo info = EMUserInfo(EMClient.getInstance.currentUsername);
1660+
info.copyWith(
1661+
sign: "修改签名",
1662+
nickName: "用户属性昵称",
1663+
1664+
);
1665+
await EMClient.getInstance.userInfoManager.updateOwnUserInfo(info);
16741666
} on EMError catch (e) {
16751667
print('操作失败,原因是: $e');
16761668
}
16771669
```
1670+
16781671
#### 获取多用户的用户属性
16791672
```dart
16801673
try {

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

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -526,44 +526,7 @@ static Map<String, Object> toJson(EMMessage message) {
526526
}
527527

528528
if (message.ext().size() > 0 && null != message.ext()) {
529-
HashMap<String, Object> map = new HashMap<>();
530-
for (Map.Entry entry:message.ext().entrySet()) {
531-
String key = entry.getKey().toString();
532-
try {
533-
JSONObject value = message.getJSONObjectAttribute(key);
534-
map.put(key, value);
535-
continue;
536-
}
537-
catch (HyphenateException e) {
538-
}
539-
try {
540-
boolean value = message.getBooleanAttribute(key);
541-
map.put(key, value);
542-
continue;
543-
} catch (HyphenateException e) {
544-
}
545-
546-
try {
547-
JSONArray value = message.getJSONArrayAttribute(key);
548-
map.put(key, value);
549-
continue;
550-
} catch (HyphenateException e) {
551-
}
552-
try {
553-
int value = message.getIntAttribute(key);
554-
map.put(key, value);
555-
continue;
556-
} catch (HyphenateException e){
557-
}
558-
559-
try {
560-
String value = message.getStringAttribute(key);
561-
map.put(key, value);
562-
continue;
563-
} catch (HyphenateException e) {
564-
}
565-
}
566-
data.put("attributes", map);
529+
data.put("attributes", message.ext());
567530
}
568531
data.put("from", message.getFrom());
569532
data.put("to", message.getTo());

example/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
97C146E61CF9000F007C117D /* Project object */ = {
162162
isa = PBXProject;
163163
attributes = {
164-
LastUpgradeCheck = 1020;
164+
LastUpgradeCheck = 1300;
165165
ORGANIZATIONNAME = "";
166166
TargetAttributes = {
167167
97C146ED1CF9000F007C117D = {

example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1300"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

example/lib/pages/account/login_page.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import 'dart:ui';
2-
31
import 'package:easeim_flutter_demo/widgets/common_widgets.dart';
42
import 'package:flutter/material.dart';
53
import 'package:flutter_smart_dialog/flutter_smart_dialog.dart';

example/lib/pages/chat/chat_page.dart

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -372,13 +372,6 @@ class _ChatPageState extends State<ChatPage>
372372
/// 消息长按
373373
_messageOnLongPress(EMMessage msg) async {
374374
print('长按消息 $msg');
375-
String toAddUsername;
376-
String reason;
377-
try {
378-
EMClient.getInstance.contactManager.addContact(toAddUsername, reason);
379-
} on EMError catch (e) {
380-
debugPrint(e.toString());
381-
}
382375
}
383376

384377
/// 发送文字消息

example/lib/widgets/wx_expression.dart

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import 'dart:ui';
2-
3-
import 'package:flutter/cupertino.dart';
41
import 'package:flutter/material.dart';
52

63
///表情组件

ios/Classes/EMChatManagerWrapper.m

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ - (void)importMessages:(NSDictionary *)param
375375
result:(FlutterResult)result {
376376
__weak typeof(self) weakSelf = self;
377377
NSArray *dictAry = param[@"messages"];
378-
NSMutableArray *messages;
378+
NSMutableArray *messages = [NSMutableArray array];
379379
for (NSDictionary *dict in dictAry) {
380380
[messages addObject:[EMMessage fromJson:dict]];
381381
}
@@ -395,7 +395,8 @@ - (void)downloadAttachment:(NSDictionary *)param
395395
result:(FlutterResult)result {
396396
__weak typeof(self) weakSelf = self;
397397
__block EMMessage *msg = [EMMessage fromJson:param[@"message"]];
398-
[EMClient.sharedClient.chatManager downloadMessageAttachment:msg
398+
EMMessage *needDownMSg = [EMClient.sharedClient.chatManager getMessageWithMessageId:msg.messageId];
399+
[EMClient.sharedClient.chatManager downloadMessageAttachment:needDownMSg
399400
progress:^(int progress)
400401
{
401402
[weakSelf.messageChannel invokeMethod:EMMethodKeyOnMessageProgressUpdate
@@ -432,7 +433,8 @@ - (void)downloadThumbnail:(NSDictionary *)param
432433
result:(FlutterResult)result {
433434
__weak typeof(self) weakSelf = self;
434435
__block EMMessage *msg = [EMMessage fromJson:param[@"message"]];
435-
[EMClient.sharedClient.chatManager downloadMessageThumbnail:msg
436+
EMMessage *needDownMSg = [EMClient.sharedClient.chatManager getMessageWithMessageId:msg.messageId];
437+
[EMClient.sharedClient.chatManager downloadMessageThumbnail:needDownMSg
436438
progress:^(int progress)
437439
{
438440
[weakSelf.messageChannel invokeMethod:EMMethodKeyOnMessageProgressUpdate
@@ -638,6 +640,7 @@ - (void)onConversationRead:(NSString *)from
638640
- (void)messagesDidReceive:(NSArray *)aMessages {
639641
NSMutableArray *msgList = [NSMutableArray array];
640642
for (EMMessage *msg in aMessages) {
643+
641644
[msgList addObject:[msg toJson]];
642645
}
643646
[self.channel invokeMethod:EMMethodKeyOnMessagesReceived

lib/src/em_chat_manager.dart

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import "dart:async";
22

33
import 'package:flutter/services.dart';
44
import 'package:im_flutter_sdk/im_flutter_sdk.dart';
5-
import 'models/em_domain_terms.dart';
6-
import 'em_sdk_method.dart';
75

86
class EMChatManager implements EMMessageStatusListener {
97
static const _channelPrefix = 'com.easemob.im';

0 commit comments

Comments
 (0)