Skip to content

Commit 2d78e42

Browse files
guangyaoguangyao
authored andcommitted
Fix
1 parent ffb7766 commit 2d78e42

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed

NIM.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const { RNNeteaseIm } = NativeModules;
55

66
export default class NIM{
77

8+
89
// static init(){
910
// return RNNeteaseIm.init();
1011
// }

ios/RNNeteaseIm/RNNeteaseIm/NIMModel.m

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,10 @@ -(void)setContactList:(NSMutableDictionary *)contactList{
5151
}
5252
}
5353
-(void)setNotiArr:(NSMutableArray *)notiArr{
54-
self.myBlock(5, notiArr);
54+
if (_notiArr != notiArr) {
55+
_notiArr = notiArr;
56+
self.myBlock(5, notiArr);
57+
}
5558
}
5659
-(void)setTeamArr:(NSMutableArray *)teamArr{
5760
self.myBlock(4, teamArr);

ios/RNNeteaseIm/RNNeteaseIm/NIMViewController.m

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ - (void)onLogin:(NIMLoginStep)step{
8080
default:
8181
break;
8282
}
83+
NSLog(@"--------------------%@",strStatus);
8384
[NIMModel initShareMD].NetStatus = strStatus;
8485
}
8586
//删除一行

ios/RNNeteaseIm/RNNeteaseIm/NoticeViewController.m

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,13 +187,15 @@ - (void)updateSourceMember:(NIMKitInfo *)sourceMember andNoti:(NIMSystemNotifica
187187
break;
188188
case NIMUserOperationRequest:
189189
isVerify = @"1";
190-
verifyText = @"请求添加你为好友";
190+
verifyText = [noti.postscript length]?noti.postscript:@"请求添加你为好友";
191191
break;
192192
case NIMUserOperationVerify:
193193
verifyText = @"通过了你的好友请求";
194+
noti.handleStatus = NotificationHandleTypeOk;
194195
break;
195196
case NIMUserOperationReject:
196197
verifyText = @"拒绝了你的好友请求";
198+
noti.handleStatus = NotificationHandleTypeNo;
197199
break;
198200
default:
199201
break;
@@ -251,7 +253,9 @@ -(void)deleAllNotic{
251253
}
252254
-(void)refrash{
253255
NIMModel *mode = [NIMModel initShareMD];
254-
mode.notiArr = _notiArr;
256+
NSMutableArray *ok = [NSMutableArray array];
257+
258+
mode.notiArr = ok;
255259
}
256260
//返回标记为已读
257261
-(void)setAllread{
@@ -435,7 +439,7 @@ -(void)onRefuse:(NSString *)targetID timestamp:(NSString *)timestamp sucess:(Suc
435439
completion:^(NSError *error) {
436440
if (!error) {
437441

438-
// notices.handleStatus = NotificationHandleTypeNo;
442+
notices.handleStatus = NotificationHandleTypeNo;
439443
// [_notifications replaceObjectAtIndex:i withObject:notices];
440444
// for (NIMSystemNotification *notices in _notifications) {
441445
// NIMKitInfo *sourceMember = [[NIMKit sharedKit] infoByUser:notices.sourceID option:nil];

ios/RNNeteaseIm/RNNeteaseIm/RNNeteaseIm.m

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,21 @@ - (dispatch_queue_t)methodQueue
1717
return dispatch_get_main_queue();
1818
}
1919

20+
2021
RCT_EXPORT_MODULE()
22+
23+
24+
2125
//手动登录
2226
RCT_EXPORT_METHOD(login:(nonnull NSString *)account token:(nonnull NSString *)token
2327
resolve:(RCTPromiseResolveBlock)resolve
2428
reject:(RCTPromiseRejectBlock)reject){
29+
[self setSendState];
30+
[[NIMViewController initWithController] addDelegate];
31+
[[NoticeViewController initWithNoticeViewController]initWithDelegate];
2532
//请将 NIMMyAccount 以及 NIMMyToken 替换成您自己提交到此App下的账号和密码
2633
[[NIMSDK sharedSDK].loginManager login:account token:token completion:^(NSError *error) {
2734
if (!error) {
28-
29-
[self setSendState];
30-
[[NIMViewController initWithController] addDelegate];
31-
[[RNNotificationCenter sharedCenter] start];
32-
[[NoticeViewController initWithNoticeViewController]initWithDelegate];
3335
resolve(account);
3436
}else{
3537
NSString *strEorr = @"登录失败";

0 commit comments

Comments
 (0)