MOMainTabController+ChatNotifi.m 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //
  2. // MOMainTabController+ChatNotifi.m
  3. // MiMoLive
  4. //
  5. // Created by SuperC on 2025/6/4.
  6. //
  7. #import "MOMainTabController+ChatNotifi.h"
  8. #import "TUIBaseChatViewController.h"
  9. #import "MOChatViewController.h"
  10. @implementation MOMainTabController (ChatNotifi)
  11. - (void)setChatNotifiClickBlock{
  12. //点击APP内消息回调
  13. WEAKSELF
  14. [[MOChatNotificationManager sharedManager] setupNotificationTapHandler:^(V2TIMMessage * _Nonnull msg) {
  15. [weakSelf toShowChatViewControllerWithChatId:msg];
  16. }];
  17. }
  18. - (void)toShowChatViewControllerWithChatId:(V2TIMMessage *)msg{
  19. //跳转到聊天界面
  20. if (!msg || ![msg isKindOfClass:[V2TIMMessage class]]) {
  21. return;
  22. }
  23. TUIChatConversationModel *conversationData = [TUIChatConversationModel new];
  24. conversationData.userID = msg.sender;
  25. conversationData.title = msg.nickName;
  26. conversationData.faceUrl = msg.faceURL;
  27. MOChatViewController *chatVC = [[MOChatViewController alloc] init];
  28. chatVC.t_conversationData = conversationData;
  29. chatVC.nickNameStr = msg.nickName;
  30. chatVC.hidesBottomBarWhenPushed = YES;
  31. //半屏模态弹出
  32. // chatVC.isHalfShow = YES;
  33. // UINavigationController *newNav = [[UINavigationController alloc] initWithRootViewController:chatVC];
  34. // newNav.modalPresentationStyle = UIModalPresentationOverFullScreen;
  35. UIViewController *currentVC = [MOTools currentViewController];
  36. // [currentVC.navigationController presentViewController:newNav animated:YES completion:nil];
  37. [currentVC.navigationController pushViewController:chatVC animated:YES];
  38. }
  39. @end