新增h5跳转到聊天
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user