chore: Initial clean commit

- Removed YuMi/Library/ (138 MB, not tracked)
- Removed YuMi/Resources/ (23 MB, not tracked)
- Removed old version assets (566 files, not tracked)
- Excluded Pods/, xcuserdata/ and other build artifacts
- Clean repository optimized for company server deployment
This commit is contained in:
edwinQQQ
2025-10-09 16:19:14 +08:00
commit a35a711be6
5582 changed files with 408913 additions and 0 deletions

View File

@@ -0,0 +1,243 @@
//
// AppDelegate+ThirdConfig.m
// YUMI
//
// Created by YUMI on 2021/9/13.
//
#import "AppDelegate+ThirdConfig.h"
///Third
#import <NIMSDK/NIMSDK.h>
#import <ShareSDK/ShareSDK.h>
#import <UserNotifications/UNUserNotificationCenter.h>
#import <UserNotifications/UserNotifications.h>
#import <MOBFoundation/MobSDK+Privacy.h>
///Tool
#import "YUMIConstant.h"
#import "CustomAttachmentDecoder.h"
#import "QEmotionHelper.h"
#import "XPAdvertiseView.h"
#import "XPAdImageTool.h"
#import "YUMIMacroUitls.h"
#import "AdvertiseModel.h"
#import "XPWebViewController.h"
#import "XPRoomViewController.h"
#import "XCCurrentVCStackManager.h"
#import "ClientConfig.h"
#import <UserNotifications/UserNotifications.h>
#import <Bugly/Bugly.h>
#import "BuglyManager.h"
#import <UIKit/UIDevice.h>
#import "YuMi-swift.h"
UIKIT_EXTERN NSString * kYouMiNumberCountKey;
UIKIT_EXTERN NSString * adImageName;
@implementation AppDelegate (ThirdConfig)
///
- (void)initThirdConfig{
[self setLanguage];
[self configShareSDK];
[self configNIMSDK];
[self configBugly];
[self registerNot];
[self initEmojiData];
}
-(void)setLanguage{
UISemanticContentAttribute attribute = UISemanticContentAttributeForceLeftToRight;
if (isMSRTL()) {
attribute = UISemanticContentAttributeForceRightToLeft;
}
[UIView appearance].semanticContentAttribute = attribute;
[UISearchBar appearance].semanticContentAttribute = attribute;
}
-(void)registerNot{
if (@available(iOS 10.0, *)) {
UNUserNotificationCenter *center = [UNUserNotificationCenter currentNotificationCenter];
[center requestAuthorizationWithOptions:(UNAuthorizationOptionAlert | UNAuthorizationOptionBadge | UNAuthorizationOptionSound) completionHandler:^(BOOL granted, NSError * _Nullable error) {
if (granted) {
[center getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) {
if (settings.authorizationStatus == UNAuthorizationStatusAuthorized){
dispatch_async(dispatch_get_main_queue(), ^{
[[UIApplication sharedApplication] registerForRemoteNotifications];
});
}
}];
}
}];
}
}
/**
Bugly
*/
- (void) configBugly {
// 使 BuglyManager Bugly
#ifdef DEBUG
[[BuglyManager sharedManager] configureWithAppId:@"c937fd00f7" debug:YES];
#else
[[BuglyManager sharedManager] configureWithAppId:@"8627948559" debug:NO];
#endif
}
- (void)configNIMSDK {
// NIMSDK
NSString *appKey = [[ClientConfig shareConfig].configInfo nimKey];
if ([NSString isEmpty:appKey]) {
appKey = KeyWithType(KeyType_NetEase);
}
NIMSDKOption *option = [NIMSDKOption optionWithAppKey:appKey];
#ifdef DEBUG
option.apnsCername = @"pikoDevelopPush";
#else
option.apnsCername = @"newPiko";
#endif
[[NIMSDK sharedSDK] registerWithOption:option];
// NIM SDK
[NIMCustomObject registerCustomDecoder:[[CustomAttachmentDecoder alloc] init]];
[[NIMSDKConfig sharedConfig] setShouldSyncStickTopSessionInfos:YES];
[NIMSDKConfig sharedConfig].shouldConsiderRevokedMessageUnreadCount = YES;
// cdn
[NIMSDKConfig sharedConfig].cdnTrackInterval = 0;
//
[NIMSDKConfig sharedConfig].chatroomMessageReceiveMinInterval = 50;
#ifdef DEBUG
[NIMSDKConfig sharedConfig].enabledHttpsForInfo = NO;
[NIMSDKConfig sharedConfig].enabledHttpsForMessage = NO;
#else
// HTTPS
[NIMSDKConfig sharedConfig].enabledHttpsForInfo = YES;
[NIMSDKConfig sharedConfig].enabledHttpsForMessage = YES;
#endif
}
- (void)configShareSDK {
// [PILineLoginManager registerLine];
[ShareSDK registPlatforms:^(SSDKRegister *platformsRegister) {
///faceBook
// [platformsRegister setupFacebookWithAppkey:@"1266232494209868" appSecret:@"c9b170b383f8be9cdf118823b8632821" displayName:YMLocalizedString(@"AppDelegate_ThirdConfig0")];
[platformsRegister setupLineAuthType:SSDKAuthorizeTypeBoth];
}];
NSString *isUpload = [[NSUserDefaults standardUserDefaults]valueForKey:@"kMobLinkUploadPrivacy"];
if (isUpload == nil){
[MobSDK uploadPrivacyPermissionStatus:YES onResult:nil];
[[NSUserDefaults standardUserDefaults] setValue:@"YES" forKey:@"kMobLinkUploadPrivacy"];
[[NSUserDefaults standardUserDefaults] synchronize];
}
}
#pragma mark -
- (void)initEmojiData {
dispatch_async(dispatch_get_global_queue(0, 0), ^{
NSArray * dicArray = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"emoji" ofType:@"plist"]];
NSDictionary * dic = [dicArray firstObject];
NSArray * emojiArray = dic[@"data"];
NSMutableArray * array = [NSMutableArray array];
for (int i = 0; i < emojiArray.count; i++) {
NSDictionary * emotionDic = [emojiArray xpSafeObjectAtIndex:i];
if (!emotionDic) continue;
UIImage * image = [UIImage imageNamed:emotionDic[@"file"]];
QEmotion * info = [[QEmotion alloc] init];
info.displayName = emotionDic[@"tag"];
info.identifier = emotionDic[@"id"];
info.image = image;
[array addObject:info];
}
//
QEmotionHelper *faceManager = [QEmotionHelper sharedEmotionHelper];
faceManager.emotionArray = array;
// emoji
[QEmotionHelper clearEmojiCache];
});
}
#pragma mark - 广
/**
广
*/
- (void)setupLaunchADView {
NSUserDefaults * kUserDefaults = NSUserDefaults.standardUserDefaults;
// 广
NSString *adName = [kUserDefaults stringForKey:adImageName];
NSString *filePath = [XPAdImageTool.shareImageTool getFilePathWithImageName:adName];
BOOL isExist = [XPAdImageTool.shareImageTool isFileExistWithFilePath:filePath];
if (isExist) {//
// if ([kUserDefaults integerForKey:@"adShow"] > 4) {
@kWeakify(self);
AdvertiseModel *info = [XPAdImageTool.shareImageTool getAdInfoFromCacheInMainWith:adName];
XPAdvertiseView *advertiseView = [[XPAdvertiseView alloc] initWithFrame:self.window.bounds];
advertiseView.type = info.type;
advertiseView.fileModel = info.fillVo;
advertiseView.filePath = filePath;
advertiseView.dismissHandler = ^(BOOL shouldJump) {
@kStrongify(self)
if (!shouldJump || info == nil) {
return;
}
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self advertiseJumpHandleWithInfo:info];
});
};
[advertiseView show];
// }
}
}
/// 广
- (void)advertiseJumpHandleWithInfo:(AdvertiseModel *)info {
if (UIApplication.sharedApplication.keyWindow != self.window) {
//
return;
}
switch (info.type) {
case SplashInfoSkipTypeRoom: {
if (![[XPAdImageTool shareImageTool] isImLogin]) {
return; //
}
//
if (info.link.length > 0) {
[XPRoomViewController openRoom:info.link viewController:[XCCurrentVCStackManager shareManager].getCurrentVC];
}
}
break;
case SplashInfoSkipTypeWeb:
case SplashInfoSkipTypeWeb_CP:
case SplashInfoSkipTypeWeb_Custom:
case SplashInfoSkipTypeWeb_WeekStar: {
// H5
if (info.link.length > 0) {
XPWebViewController *webView = [[XPWebViewController alloc] initWithRoomUID:nil];
webView.url = info.link;
[[[XCCurrentVCStackManager shareManager]currentNavigationController] pushViewController:webView animated:YES];
}
}
break;
default:
break;
}
}
@end