Skip to content

Commit d5be48f

Browse files
KenChoiKenChoi
authored andcommitted
fix conflict
2 parents 40cce43 + 1537066 commit d5be48f

File tree

6 files changed

+479
-25
lines changed

6 files changed

+479
-25
lines changed

example/index.ios.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ import UpdateMyInfoPage from './app/routes/UpdateMyInfo/index.js';
1616
import GroupsPage from './app/routes/Groups/index.js';
1717
import FriendInfoPage from './app/routes/FriendInfo/index.js';
1818

19-
import CardStackStyleInterpolator from 'react-navigation/src/views/CardStackStyleInterpolator';
20-
2119
const ReactJChat = StackNavigator({
2220
Launch: { screen: LaunchPage },
2321
Home: {
@@ -54,11 +52,4 @@ const ReactJChat = StackNavigator({
5452
}
5553
});
5654

57-
// ,{
58-
// headerMode: 'screen',
59-
// transitionConfig:() => ({
60-
// screenInterpolator:CardStackStyleInterpolator.forInitial,
61-
// })
62-
// }
63-
6455
AppRegistry.registerComponent('ReactJChat', () => ReactJChat);

example/ios/JMessageDemo/AppDelegate.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
1818
{
1919
NSURL *jsCodeLocation;
2020

21-
// jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
22-
jsCodeLocation = [NSURL URLWithString:@"http://192.168.9.113:8081/index.ios.bundle?platform=ios&dev=true"];
21+
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index.ios" fallbackResource:nil];
22+
// jsCodeLocation = [NSURL URLWithString:@"http://192.168.9.113:8081/index.ios.bundle?platform=ios&dev=true"];
2323
RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
2424
moduleName:@"ReactJChat"
2525
initialProperties:nil

example/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
"start": "node node_modules/react-native/local-cli/cli.js start"
66
},
77
"dependencies": {
8-
"aurora-imui-react-native": "^0.4.14",
98
"jcore-react-native": "^1.2.2",
109
"jmessage-react-plugin": "^2.1.0",
1110
"react": "16.0.0-alpha.12",
12-
"react-native": "^0.47.1",
1311
"react-native-fs": "^2.8.5",
12+
"aurora-imui-react-native": "^0.5.6",
13+
"react-native": "^0.50.0",
1414
"react-navigation": "^1.0.0-beta.11",
1515
"react-timer-mixin": "^0.13.3"
1616
},

index.js

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,11 @@ export default class JMessage {
117117
*
118118
* @param {object} params = {'field': '需要更新的字段值'}
119119
*
120-
* field 包括:nickname(昵称), birthday(生日), signature(签名), gender(性别), region(地区), address(具体地址)。
120+
* field 包括:nickname(昵称), birthday(生日), signature(签名), gender(性别), region(地区), address(具体地址),extras (附加信息)
121121
* 如:{
122122
* 'birthday': Number, // 生日日期的微秒数
123123
* 'gender': String, // 'male' / 'female' / 'unknown'
124+
* 'extras': {String: String} // 附加字段
124125
* ... // 其余皆为 String 类型
125126
* }
126127
* @param {function} success = function () {}
@@ -169,6 +170,27 @@ export default class JMessage {
169170
JMessageModule.sendMessage(params, success, error);
170171
}
171172

173+
/**
174+
* 消息转发。
175+
* 注意:只能转发消息状态为 SendSucceed 和 ReceiveSucceed 的消息。
176+
* @param {object} params = {
177+
* 'id': String, // message id
178+
* 'type': String, // 'single' / 'group'
179+
* 'groupId': String, // 当 type = group 时,groupId 不能为空
180+
* 'username': String, // 当 type = single 时,username 不能为空
181+
* 'target': Object (User or Group) // 转发的对象,
182+
* > 如果 target 是 user : {'type': 'user','username': string, appKey: string}, appkey 缺省时为应用 Appkey,
183+
* > 如果 target 是 group: {'type': 'group','id': string }
184+
*
185+
* 'messageSendingOptions': MessageSendingOptions // Optional. MessageSendingOptions 对象
186+
* }
187+
* @param {function} success = function (msg) {} // 以参数形式返回消息对象。
188+
* @param {function} error = function ({'code': '错误码', 'description': '错误信息'}) {}
189+
*/
190+
static forwardMessage(params, success, error) {
191+
JMessageModule.sendMessage(params, success, error);
192+
}
193+
172194
/**
173195
* @param {object} params = {
174196
* 'type': String, // 'single' / 'group'
@@ -496,6 +518,34 @@ export default class JMessage {
496518
JMessageModule.getBlacklist(success, error)
497519
}
498520

521+
/**
522+
* 设置是否屏蔽群消息。
523+
*
524+
* @param {Object} params = { id: String, isBlock: boolean }
525+
*/
526+
static blockGroupMessage(params, success, error) {
527+
JMessageModule.blockGroupMessage(params, success, error)
528+
}
529+
530+
/**
531+
* 判断指定群组是否被屏蔽。
532+
*
533+
* @param {object} params = { id: String }
534+
* @param {function} success = function ({ isBlocked: boolean }) {} // 以参数形式返回结果。
535+
*/
536+
static isGroupBlocked(params, success, error) {
537+
JMessageModule.isGroupBlocked(params, success, error)
538+
}
539+
540+
/**
541+
* 获取当前用户的群屏蔽列表。
542+
*
543+
* @param {function} success = function (groupArr) {} // 以参数形式返回结果。
544+
*/
545+
static getBlockedGroupList(success, error) {
546+
JMessageModule.getBlockedGroupList(success, error)
547+
}
548+
499549
/**
500550
* 设置某个用户或群组是否免打扰。
501551
*
@@ -716,7 +766,59 @@ export default class JMessage {
716766
JMessageModule.resetUnreadMessageCount(params, success, error)
717767
}
718768

769+
/**
770+
* 更新当前用户头像。
771+
*
772+
* @param {object} params = {
773+
* id: string // 目标群组的 id。
774+
* imgPath: string // 本地图片绝对路径。
775+
* }
776+
* 注意 Android 与 iOS 的文件路径是不同的:
777+
* - Android 类似:/storage/emulated/0/DCIM/Camera/IMG_20160526_130223.jpg
778+
* - iOS 类似:/var/mobile/Containers/Data/Application/7DC5CDFF-6581-4AD3-B165-B604EBAB1250/tmp/photo.jpg
779+
*/
780+
static updateGroupAvatar(params, success, error) {
781+
JMessageModule.updateGroupAvatar(params, success, error)
782+
}
783+
784+
/**
785+
* 下载用户头像缩略图,如果已经下载,不会重复下载。
786+
*
787+
* @param {object} params = {'id': String}
788+
* @param {function} success = function ({'id': String, 'filePath': String}) {}
789+
* @param {function} error = function ({'code': '错误码', 'description': '错误信息'}) {}
790+
*/
791+
static downloadThumbGroupAvatar(params, success, error) {
792+
JMessageModule.downloadThumbGroupAvatar(params, success, error)
793+
}
794+
795+
/**
796+
* 下载用户头像原图,如果已经下载,不会重复下载。
797+
*
798+
* @param {object} params = {'id': String}
799+
* @param {function} success = function ({'id': String, 'filePath': String}) {}
800+
* @param {function} error = function ({'code': '错误码', 'description': '错误信息'}) {}
801+
*/
802+
static downloadOriginalGroupAvatar(params, success, error) {
803+
JMessageModule.downloadOriginalGroupAvatar(params, success, error)
804+
}
719805

806+
/**
807+
* 增加或更新扩展字段,可扩展会话属性,比如:会话置顶、标识特殊会话等
808+
*
809+
* @param {object} params = {
810+
* 'extra': Object // 附加字段对象
811+
* 'type': String, // 'single' / 'group'
812+
* 'groupId': String, // 目标群组 id。
813+
* 'username': String, // 目标用户名。
814+
* 'appKey': String, // 目标用户所属 AppKey。
815+
* }
816+
* @param {function} success = function (conversation) {} // 具体字段参考文档
817+
* @param {function} error = function ({'code': '错误码', 'description': '错误信息'}) {}
818+
*/
819+
static setConversationExtras(params, success, error) {
820+
JMessageModule.setConversationExtras(params, success, error)
821+
}
720822

721823
/**
722824
*

ios/RCTJMessageModule/JMessageHelper.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,7 @@ -(NSMutableDictionary*)conversationToDictionary{
256256
dict[@"latestMessage"] = [self.latestMessage messageToDictionary];
257257
dict[@"unreadCount"] = self.unreadCount;
258258
dict[@"title"] = [self title];
259+
dict[@"extras"] = [self getConversationExtras];
259260
return dict;
260261
}
261262

@@ -278,6 +279,7 @@ -(NSMutableDictionary*)userToDictionary{
278279
dict[@"isNoDisturb"] = @(self.isNoDisturb);
279280
dict[@"isInBlackList"] = @(self.isInBlacklist);
280281
dict[@"isFriend"] = @(self.isFriend);
282+
dict[@"extras"] = self.extras;
281283

282284
if([[NSFileManager defaultManager] fileExistsAtPath: [self thumbAvatarLocalPath] ?: @""]){
283285
dict[@"avatarThumbPath"] = [self thumbAvatarLocalPath];

0 commit comments

Comments
 (0)