refactor: 移除友盟相关代码并清理项目结构

主要变更:
1. 从 Podfile 中移除 UMCommon 和 UMDevice 依赖,简化项目依赖管理。
2. 从 AppDelegate 中移除友盟初始化代码,减少不必要的依赖。
3. 删除 GlobalEventManager 相关文件,清理未使用的代码。

此更新旨在提升项目的可维护性,减少冗余依赖,确保代码结构更加清晰。
This commit is contained in:
edwinQQQ
2025-10-20 14:32:43 +08:00
parent c8173bf034
commit 37e105f04f
7 changed files with 2 additions and 347 deletions

View File

@@ -59,8 +59,6 @@ target 'YuMi' do
pod 'mob_sharesdk/ShareSDKPlatforms/Apple'
pod 'mob_sharesdk/ShareSDKExtension'
pod 'UMCommon', '7.5.3'
pod 'UMDevice'
pod 'ZLCollectionViewFlowLayout'
pod 'TABAnimated'
pod 'YuMi',:path=>'yum'

View File

@@ -117,9 +117,6 @@ PODS:
- TZImagePickerController/Location (= 3.8.9)
- TZImagePickerController/Basic (3.8.9)
- TZImagePickerController/Location (3.8.9)
- UMCommon (7.5.3):
- UMDevice
- UMDevice (3.4.0)
- YuMi (0.0.1)
- YXArtemis_XCFramework (1.1.6)
- YYCache (1.0.4)
@@ -173,8 +170,6 @@ DEPENDENCIES:
- TXLiteAVSDK_TRTC
- TYCyclePagerView
- TZImagePickerController
- UMCommon (= 7.5.3)
- UMDevice
- YuMi (from `yum`)
- YYText
- YYWebImage
@@ -231,8 +226,6 @@ SPEC REPOS:
- TXLiteAVSDK_TRTC
- TYCyclePagerView
- TZImagePickerController
- UMCommon
- UMDevice
- YXArtemis_XCFramework
- YYCache
- YYImage
@@ -294,8 +287,6 @@ SPEC CHECKSUMS:
TXLiteAVSDK_TRTC: 09552a5bb5571c85c851d8dd858064724639f55e
TYCyclePagerView: 2b051dade0615c70784aa34f40c646feeddb7344
TZImagePickerController: 456f470b5dea97b37226ec7a694994a8663340b2
UMCommon: 3b850836e8bc162b4e7f6b527d30071ed8ea75a1
UMDevice: dcdf7ec167387837559d149fbc7d793d984faf82
YuMi: 6c5f00f1eccbcea3304feae03cbe659025fdb9cb
YXArtemis_XCFramework: d9a8b9439d7a6c757ed00ada53a6d2dd9b13f9c7
YYCache: 8105b6638f5e849296c71f331ff83891a4942952
@@ -304,6 +295,6 @@ SPEC CHECKSUMS:
YYWebImage: 5f7f36aee2ae293f016d418c7d6ba05c4863e928
ZLCollectionViewFlowLayout: c99024652ce9f0c57d33ab53052c9b85e4a936b7
PODFILE CHECKSUM: 581cecb560110b972c7e8c7d4b01e24a5deaf833
PODFILE CHECKSUM: d5711204ab1ef02306ef99f8becb2c93780a1210
COCOAPODS: 1.16.2

View File

@@ -394,7 +394,6 @@
4C06427F2E97BD6D00BAF413 /* EPMineHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0642732E97BD6D00BAF413 /* EPMineHeaderView.m */; };
4C0642802E97BD6D00BAF413 /* EPMomentCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C06427A2E97BD6D00BAF413 /* EPMomentCell.m */; };
4C0642852E97BD9500BAF413 /* APIConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C0642842E97BD9500BAF413 /* APIConfig.swift */; };
4C0642882E97BDA300BAF413 /* GlobalEventManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0642872E97BDA300BAF413 /* GlobalEventManager.m */; };
4C06428B2E98DC5F00BAF413 /* EPTabBarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4C06428A2E98DC5F00BAF413 /* EPTabBarController.swift */; };
4C0642912E98DC8700BAF413 /* EPMomentViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0642902E98DC8700BAF413 /* EPMomentViewController.m */; };
4C0642992E98F77900BAF413 /* EPMomentListView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C0642982E98F77900BAF413 /* EPMomentListView.m */; };
@@ -2442,8 +2441,6 @@
4C0642792E97BD6D00BAF413 /* EPMomentCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EPMomentCell.h; sourceTree = "<group>"; };
4C06427A2E97BD6D00BAF413 /* EPMomentCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = EPMomentCell.m; sourceTree = "<group>"; };
4C0642842E97BD9500BAF413 /* APIConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = APIConfig.swift; sourceTree = "<group>"; };
4C0642862E97BDA300BAF413 /* GlobalEventManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GlobalEventManager.h; sourceTree = "<group>"; };
4C0642872E97BDA300BAF413 /* GlobalEventManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GlobalEventManager.m; sourceTree = "<group>"; };
4C0642892E97BDC900BAF413 /* YuMi-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "YuMi-Bridging-Header.h"; sourceTree = "<group>"; };
4C06428A2E98DC5F00BAF413 /* EPTabBarController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EPTabBarController.swift; sourceTree = "<group>"; };
4C06428F2E98DC8700BAF413 /* EPMomentViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = EPMomentViewController.h; sourceTree = "<group>"; };
@@ -8360,8 +8357,6 @@
E81C279926EB64BA0031E639 /* Global */ = {
isa = PBXGroup;
children = (
4C0642862E97BDA300BAF413 /* GlobalEventManager.h */,
4C0642872E97BDA300BAF413 /* GlobalEventManager.m */,
4C84A9C92E602B1A002C10FC /* BuglyManager.h */,
4C84A9CA2E602B1A002C10FC /* BuglyManager.m */,
E81C279A26EB65560031E639 /* YUMIMacroUitls.h */,
@@ -12985,7 +12980,6 @@
E85E7B162A4EB0D200B6D00A /* GuildInfoModel.m in Sources */,
E885D53C2977FBFD004DC088 /* MessageTimeView.m in Sources */,
E8AC723A26F49AAE007D6E91 /* XPMineNotifyStatus.m in Sources */,
4C0642882E97BDA300BAF413 /* GlobalEventManager.m in Sources */,
E87DF50E2A42CF15009C1185 /* HomeLiveRoomModel.m in Sources */,
E8F6135F291E274E00E12650 /* NSArray+Safe.m in Sources */,
4C44BD5D2D151B5C00F321FA /* RoomSideMenu.m in Sources */,
@@ -13813,10 +13807,6 @@
"-framework",
"\"UIKit\"",
"-framework",
"\"UMCommon\"",
"-framework",
"\"UMDevice\"",
"-framework",
"\"VideoToolbox\"",
"-framework",
"\"YXArtemis\"",
@@ -14059,10 +14049,6 @@
"-framework",
"\"UIKit\"",
"-framework",
"\"UMCommon\"",
"-framework",
"\"UMDevice\"",
"-framework",
"\"VideoToolbox\"",
"-framework",
"\"YXArtemis\"",

View File

@@ -7,7 +7,6 @@
#import "AppDelegate.h"
#import <UMCommon/UMCommon.h>
#import <MobLinkPro/MobLink.h>
#import <MobLinkPro/MLSDKScene.h>
#import "TabbarViewController.h"
@@ -115,12 +114,7 @@ void qg_VAP_Logger_handler(VAPLogLevel level, const char* file, int line, const
- (void)initUM:(UIApplication *)application
launchOptions:(NSDictionary *)launchOptions {
//
if ([[NSUserDefaults standardUserDefaults] objectForKey:@"kYouMinumbernnagna"]) {
///
[UMConfigure initWithAppkey:@"6434c6dfd64e686139618269"
channel:@"appstore"];
}
// MobLink
[MobLink setDelegate:self];
}

View File

@@ -1,71 +0,0 @@
//
// GlobalEventManager.h
// YuMi
//
// Created by AI on 2025-10-09.
// Copyright © 2025 YuMi. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/// 全局事件管理器
/// 负责处理原 TabBar 中的全局逻辑SDK 代理、房间最小化、通知等)
@interface GlobalEventManager : NSObject
/// 单例
+ (instancetype)shared;
// MARK: - SDK Delegates Setup
/// 设置所有第三方 SDK 的代理
- (void)setupSDKDelegates;
/// 移除所有代理dealloc 时调用)
- (void)removeAllDelegates;
// MARK: - Room Mini View
/// 设置房间最小化视图
/// @param containerView 父视图(通常是 TabBar 的 view
- (void)setupRoomMiniViewOn:(UIView *)containerView;
/// 处理房间最小化通知
/// @param userInfo 通知携带的数据
- (void)handleRoomMini:(NSDictionary * _Nullable)userInfo;
/// 隐藏房间最小化视图
- (void)hideRoomMiniView;
// MARK: - Global Notifications
/// 处理配置重载通知
- (void)handleConfigReload;
/// 处理新用户充值通知
- (void)handleNewUserRecharge;
/// 处理主播卡片通知
/// @param notification 通知对象
- (void)handleAnchorCard:(NSNotification * _Nullable)notification;
/// 处理语言切换通知
/// @param notification 通知对象
- (void)handleLanguageSwitch:(NSNotification * _Nullable)notification;
// MARK: - User Info
/// 获取用户信息成功后的处理
/// @param userInfo 用户信息模型
- (void)handleUserInfoSuccess:(id)userInfo;
// MARK: - Social Share
/// 注册社交分享回调
- (void)registerSocialShareCallback;
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,242 +0,0 @@
//
// GlobalEventManager.m
// YuMi
//
// Created by AI on 2025-10-09.
// Copyright © 2025 YuMi. All rights reserved.
//
#import "GlobalEventManager.h"
#import "XPMiniRoomView.h"
#import "RoomBoomManager.h"
#import "PublicRoomManager.h"
#import "XPSkillCardPlayerManager.h"
#import "SocialShareManager.h"
#import "YUMIConstant.h"
#import <NIMSDK/NIMSDK.h>
@interface GlobalEventManager () <NIMLoginManagerDelegate, NIMChatManagerDelegate, NIMSystemNotificationManagerDelegate, NIMBroadcastManagerDelegate>
// MARK: - Private Properties
///
@property (nonatomic, strong) XPMiniRoomView *miniRoomView;
///
@property (nonatomic, copy) void(^configReloadCallback)(void);
///
@property (nonatomic, copy) void(^newUserRechargeCallback)(void);
@end
@implementation GlobalEventManager
// MARK: - Lifecycle
+ (instancetype)shared {
static GlobalEventManager *instance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
instance = [[GlobalEventManager alloc] init];
});
return instance;
}
- (instancetype)init {
if (self = [super init]) {
[self setupNotificationObservers];
}
return self;
}
- (void)dealloc {
[self removeAllDelegates];
[[NSNotificationCenter defaultCenter] removeObserver:self];
}
// MARK: - SDK Delegates Setup
- (void)setupSDKDelegates {
// NIMSDK
[[NIMSDK sharedSDK].loginManager addDelegate:self];
[[NIMSDK sharedSDK].chatManager addDelegate:self];
[[NIMSDK sharedSDK].systemNotificationManager addDelegate:self];
[[NIMSDK sharedSDK].broadcastManager addDelegate:self];
// RoomBoomManager
__weak typeof(self) weakSelf = self;
[[RoomBoomManager sharedManager] registerBoomBanner:^(id sth) {
__strong typeof(weakSelf) strongSelf = weakSelf;
if (!strongSelf) return;
dispatch_async(dispatch_get_main_queue(), ^{
//
if ([XPSkillCardPlayerManager shareInstance].isInRoom) {
NSLog(@"[GlobalEventManager] 收到 RoomBoom 通知");
// TODO: Boom Banner
// [RoomBoomBannerAnimation display:window with:sth tapToRoom:YES complete:^{}];
}
});
} target:self];
NSLog(@"[GlobalEventManager] SDK 代理设置完成");
}
- (void)removeAllDelegates {
[[NIMSDK sharedSDK].loginManager removeDelegate:self];
[[NIMSDK sharedSDK].chatManager removeDelegate:self];
[[NIMSDK sharedSDK].systemNotificationManager removeDelegate:self];
[[NIMSDK sharedSDK].broadcastManager removeDelegate:self];
[[RoomBoomManager sharedManager] removeEventListenerForTarget:self];
NSLog(@"[GlobalEventManager] 所有代理已移除");
}
// MARK: - Room Mini View
- (void)setupRoomMiniViewOn:(UIView *)containerView {
if (!self.miniRoomView) {
self.miniRoomView = [[XPMiniRoomView alloc] init];
}
[containerView addSubview:self.miniRoomView];
NSLog(@"[GlobalEventManager] 房间最小化视图已添加");
}
- (void)handleRoomMini:(NSDictionary *)userInfo {
if (self.miniRoomView) {
// TODO:
NSLog(@"[GlobalEventManager] 处理房间最小化: %@", userInfo);
}
}
- (void)hideRoomMiniView {
if (self.miniRoomView) {
[self.miniRoomView hiddenRoomMiniView];
NSLog(@"[GlobalEventManager] 房间最小化视图已隐藏");
}
}
// MARK: - Notification Observers
- (void)setupNotificationObservers {
NSNotificationCenter *center = [NSNotificationCenter defaultCenter];
//
[center addObserver:self
selector:@selector(onRoomMiniNotification:)
name:kRoomMiniNotificationKey
object:nil];
//
[center addObserver:self
selector:@selector(onConfigReloadNotification:)
name:@"reloadAfterLoadConfig"
object:nil];
//
[center addObserver:self
selector:@selector(onLanguageSwitchNotification:)
name:@"kSwitchLanguage"
object:nil];
NSLog(@"[GlobalEventManager] 通知监听已设置");
}
- (void)onRoomMiniNotification:(NSNotification *)notification {
[self handleRoomMini:notification.userInfo];
}
- (void)onConfigReloadNotification:(NSNotification *)notification {
[self handleConfigReload];
}
- (void)onLanguageSwitchNotification:(NSNotification *)notification {
[self handleLanguageSwitch:notification];
}
// MARK: - Global Notifications Handler
- (void)handleConfigReload {
NSLog(@"[GlobalEventManager] 配置重载");
if (self.configReloadCallback) {
self.configReloadCallback();
}
}
- (void)handleNewUserRecharge {
NSLog(@"[GlobalEventManager] 新用户充值");
if (self.newUserRechargeCallback) {
self.newUserRechargeCallback();
}
}
- (void)handleAnchorCard:(NSNotification *)notification {
NSLog(@"[GlobalEventManager] 主播卡片通知: %@", notification.userInfo);
// TODO:
}
- (void)handleLanguageSwitch:(NSNotification *)notification {
NSLog(@"[GlobalEventManager] 语言切换: %@", notification.userInfo);
// TODO:
}
// MARK: - User Info
- (void)handleUserInfoSuccess:(id)userInfo {
NSLog(@"[GlobalEventManager] 用户信息获取成功");
// Manager
if ([userInfo respondsToSelector:@selector(uid)]) {
[[PublicRoomManager sharedManager] initialize];
[[PublicRoomManager sharedManager] updateUserInfo:userInfo];
[[RoomBoomManager sharedManager] saveUserInfo:userInfo];
[[XPSkillCardPlayerManager shareInstance] setUserInfoModel:userInfo];
}
}
// MARK: - Social Share
- (void)registerSocialShareCallback {
// 2
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[[SocialShareManager sharedManager] checkSocialShareItem];
NSLog(@"[GlobalEventManager] 社交分享回调已注册");
});
}
// MARK: - NIMSDK Delegate Methods
#pragma mark - NIMLoginManagerDelegate
- (void)onLogin:(NIMLoginStep)step {
NSLog(@"[GlobalEventManager] NIMSDK 登录步骤: %ld", (long)step);
}
- (void)onKickout:(NIMKickReason)code clientType:(NIMLoginClientType)clientType {
NSLog(@"[GlobalEventManager] NIMSDK 被踢出: reason=%ld, clientType=%ld", (long)code, (long)clientType);
}
- (void)onAutoLoginFailed:(NSError *)error {
NSLog(@"[GlobalEventManager] NIMSDK 自动登录失败: %@", error);
}
#pragma mark - NIMChatManagerDelegate
- (void)onRecvMessages:(NSArray<NIMMessage *> *)messages {
NSLog(@"[GlobalEventManager] 收到 %lu 条消息", (unsigned long)messages.count);
}
#pragma mark - NIMSystemNotificationManagerDelegate
- (void)onReceiveSystemNotification:(NIMSystemNotification *)notification {
NSLog(@"[GlobalEventManager] 收到系统通知: %@", notification.notificationId);
}
#pragma mark - NIMBroadcastManagerDelegate
- (void)onReceiveBroadcastMessage:(NIMBroadcastMessage *)message {
NSLog(@"[GlobalEventManager] 收到广播消息: %@", message.content);
}
@end

View File

@@ -17,7 +17,6 @@
#import <UIKit/UIKit.h>
// MARK: - New Modules (White Label)
#import "GlobalEventManager.h"
#import "EPMomentViewController.h"
#import "EPMineViewController.h"
#import "EPMomentCell.h"