新增h5跳转到聊天

This commit is contained in:
liyuhua
2023-08-18 10:41:30 +08:00
parent 6416529e04
commit 7ded8add3d
4 changed files with 42 additions and 2 deletions

View File

@@ -34,6 +34,7 @@
#import "XPHomeContainerPresenter.h"
#import "XPHomeContainerProtocol.h"
#import "ClientConfig.h"
#import "SessionViewController.h"
UIKIT_EXTERN NSString * kHomeMoreScrollPageKey;
UIKIT_EXTERN NSString * const kOpenRoomNotification;
@@ -95,11 +96,31 @@ UIKIT_EXTERN NSString * const kOpenRoomNotification;
[self opRoom:[ClientConfig shareConfig].roomId];
[ClientConfig shareConfig].roomId = nil;
}
if([ClientConfig shareConfig].chatId != nil){
NIMSession * session = [NIMSession session:[ClientConfig shareConfig].chatId type:NIMSessionTypeP2P];
SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session];
[self.navigationController pushViewController:sessionVC animated:YES];
[ClientConfig shareConfig].chatId = nil;
}
}
-(void)openRoomNotification:(NSNotification *)notification{
NSString *uid = notification.userInfo[@"uid"];
NSString *type = notification.userInfo[@"type"];
if([type isEqualToString:@"kOpenChat"]){
if (uid.length > 0) {
NIMSession * session = [NIMSession session:uid type:NIMSessionTypeP2P];
SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session];
[self.navigationController pushViewController:sessionVC animated:YES];
[ClientConfig shareConfig].chatId = nil;
}
return;
}
ClientConfig *config = [ClientConfig shareConfig];
config.chatId = uid;
if(uid != nil){
[self opRoom:uid];
[ClientConfig shareConfig].roomId = nil;
}
}
- (void)initSubViewConstraints {