更换项目
This commit is contained in:
@@ -6,20 +6,22 @@
|
||||
//
|
||||
|
||||
#import "AppDelegate+ThirdConfig.h"
|
||||
///Third
|
||||
#import <NIMSDK/NIMSDK.h>
|
||||
#import <ShareSDK/ShareSDK.h>
|
||||
#import <UserNotifications/UNUserNotificationCenter.h>
|
||||
///Tool
|
||||
#import "YUMIConstant.h"
|
||||
#import "CustomAttachmentDecoder.h"
|
||||
#import "MHTSpiritFacilitater.h"
|
||||
#import "YUMIAdvertiseRegard.h"
|
||||
#import "YUMIAdIndicateTool.h"
|
||||
#import "QEmotionHelper.h"
|
||||
#import "XPAdvertiseView.h"
|
||||
#import "XPAdImageTool.h"
|
||||
#import "YUMIMacroUitls.h"
|
||||
#import "AdvertiseMatrix.h"
|
||||
#import "YUMITissueRegardGovernancer.h"
|
||||
#import "YUMIChamberRegardGovernancer.h"
|
||||
#import "XCCurrentVCStackExecutive.h"
|
||||
#import "ClientDisposition.h"
|
||||
#import "AdvertiseModel.h"
|
||||
#import "XPWebViewController.h"
|
||||
#import "XPRoomViewController.h"
|
||||
#import "XCCurrentVCStackManager.h"
|
||||
#import "ClientConfig.h"
|
||||
|
||||
UIKIT_EXTERN NSString * kYouMiNumberCountKey;
|
||||
UIKIT_EXTERN NSString * adImageName;
|
||||
@@ -27,22 +29,23 @@ UIKIT_EXTERN NSString * adImageName;
|
||||
@implementation AppDelegate (ThirdConfig)
|
||||
|
||||
|
||||
- (void)initTertiusDisposition {
|
||||
[self prohibitipositionPartowardsiciptowardsionSDK];
|
||||
[self prohibitipositionNEMCSDK];
|
||||
[self initEmojiTowardsoloudspeaker];
|
||||
/// 初始化一些第三方配置
|
||||
- (void)initThirdConfig {
|
||||
[self configShareSDK];
|
||||
[self configNIMSDK];
|
||||
[self initEmojiData];
|
||||
}
|
||||
|
||||
- (void)prohibitipositionNEMCSDK {
|
||||
|
||||
NSString *appKey = KeyWithType(KeyGenre_NetEase);
|
||||
- (void)configNIMSDK {
|
||||
//推荐在程序启动的时候初始化 NIMSDK
|
||||
NSString *appKey = KeyWithType(KeyType_NetEase);
|
||||
NIMSDKOption *option = [NIMSDKOption optionWithAppKey:appKey];
|
||||
[[NIMSDK sharedSDK] registerWithOption:option];
|
||||
|
||||
|
||||
// NIM SDK初始化
|
||||
[NIMCustomObject registerCustomDecoder:[[CustomAttachmentDecoder alloc] init]];
|
||||
[NIMSDKConfig sharedConfig].shouldConsiderRevokedMessageUnreadCount = YES;
|
||||
|
||||
///置顶会话同步
|
||||
[[NIMSDKConfig sharedConfig] setShouldSyncStickTopSessionInfos:YES];
|
||||
#ifdef DEBUG
|
||||
[NIMSDKConfig sharedConfig].enabledHttpsForInfo = NO;
|
||||
@@ -51,16 +54,16 @@ UIKIT_EXTERN NSString * adImageName;
|
||||
}
|
||||
|
||||
|
||||
- (void)prohibitipositionPartowardsiciptowardsionSDK {
|
||||
- (void)configShareSDK {
|
||||
[ShareSDK registPlatforms:^(SSDKRegister *platformsRegister) {
|
||||
|
||||
[platformsRegister setupFacebookWithAppkey:@"1266232494209868" appSecret:@"c9b170b383f8be9cdf118823b8632821" displayName:YMLocalizedString(@"App_Delegate__Third_Config_0")];
|
||||
///faceBook
|
||||
[platformsRegister setupFacebookWithAppkey:@"1266232494209868" appSecret:@"c9b170b383f8be9cdf118823b8632821" displayName:YMLocalizedString(@"AppDelegate_ThirdConfig0")];
|
||||
[platformsRegister setupLineAuthType:SSDKAuthorizeTypeBoth];
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - 表情
|
||||
- (void)initEmojiTowardsoloudspeaker {
|
||||
- (void)initEmojiData {
|
||||
NSArray * dicArray = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"emoji" ofType:@"plist"]];
|
||||
NSDictionary * dic = [dicArray firstObject];
|
||||
NSArray * emojiArray = dic[@"data"];
|
||||
@@ -68,25 +71,27 @@ UIKIT_EXTERN NSString * adImageName;
|
||||
for (int i = 0; i < emojiArray.count; i++) {
|
||||
NSDictionary * dic = [emojiArray objectAtIndex:i];
|
||||
UIImage * image = [UIImage imageNamed:dic[@"file"]];
|
||||
MHTSpirit * info = [[MHTSpirit alloc] init];
|
||||
QEmotion * info = [[QEmotion alloc] init];
|
||||
info.identifier = dic[@"id"];
|
||||
info.image = image;
|
||||
info.displayName = dic[@"tag"];
|
||||
[array addObject:info];
|
||||
}
|
||||
|
||||
MHTSpiritFacilitater *faceManager = [MHTSpiritFacilitater partowardsiciptowardsiondSenintrtowardsemporalntFacilittowardseer];
|
||||
faceManager.senintratemporalntGarment = array;
|
||||
//在这里强烈建议先预加载一下表情
|
||||
QEmotionHelper *faceManager = [QEmotionHelper sharedEmotionHelper];
|
||||
faceManager.emotionArray = array;
|
||||
}
|
||||
|
||||
#pragma mark - 广告
|
||||
|
||||
|
||||
- (void)setupLaunchADRegard {
|
||||
/**
|
||||
设置广告页
|
||||
*/
|
||||
- (void)setupLaunchADView {
|
||||
NSUserDefaults * kUserDefaults = NSUserDefaults.standardUserDefaults;
|
||||
|
||||
NSString *filePath = [YUMIAdIndicateTool.partowardsiciptowardsionIndictowardseUtensil acquireAccurtowardseRouteAboutIndictowardseConstitute:[kUserDefaults valueForKey:adImageName]];
|
||||
BOOL isExist = [YUMIAdIndicateTool.partowardsiciptowardsionIndictowardseUtensil isAccurtowardseExistAboutAccurtowardseRoute:filePath];
|
||||
// 判断沙盒中是否存在广告图片,如果存在,直接显示
|
||||
NSString *filePath = [XPAdImageTool.shareImageTool getFilePathWithImageName:[kUserDefaults valueForKey:adImageName]];
|
||||
BOOL isExist = [XPAdImageTool.shareImageTool isFileExistWithFilePath:filePath];
|
||||
NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults];
|
||||
|
||||
if ([userDefault integerForKey:@"adShow"]) {
|
||||
@@ -95,20 +100,20 @@ UIKIT_EXTERN NSString * adImageName;
|
||||
[userDefault setInteger:1 forKey:@"adShow"];
|
||||
}
|
||||
|
||||
if (isExist) {
|
||||
if (isExist) {// 图片存在
|
||||
|
||||
if ([userDefault integerForKey:@"adShow"] > 4) {
|
||||
@kWeakify(self);
|
||||
NSString *imageName = [kUserDefaults valueForKey:adImageName];
|
||||
AdvertiseMatrix *info = [YUMIAdIndicateTool.partowardsiciptowardsionIndictowardseUtensil acquireDirectoryAbstractByvirtueofConcealInMainAbout:imageName];
|
||||
YUMIAdvertiseRegard *advertiseView = [[YUMIAdvertiseRegard alloc] initWithFrame:self.window.bounds];
|
||||
AdvertiseModel *info = [XPAdImageTool.shareImageTool getAdInfoFromCacheInMainWith:imageName];
|
||||
XPAdvertiseView *advertiseView = [[XPAdvertiseView alloc] initWithFrame:self.window.bounds];
|
||||
advertiseView.filePath = filePath;
|
||||
advertiseView.disappearHandler = ^(BOOL shouldJump) {
|
||||
advertiseView.dismissHandler = ^(BOOL shouldJump) {
|
||||
@kStrongify(self)
|
||||
if (!shouldJump || info == nil) {
|
||||
return;
|
||||
}
|
||||
[self performSelectorOnMainThread:@selector(advertiseJumpShankAboutAbstract:) withObject:info waitUntilDone:NO];
|
||||
[self performSelectorOnMainThread:@selector(advertiseJumpHandleWithInfo:) withObject:info waitUntilDone:NO];
|
||||
};
|
||||
[advertiseView show];
|
||||
}
|
||||
@@ -116,32 +121,33 @@ UIKIT_EXTERN NSString * adImageName;
|
||||
}
|
||||
|
||||
|
||||
- (void)advertiseJumpShankAboutAbstract:(AdvertiseMatrix *)info {
|
||||
if (![ClientDisposition partowardsiciptowardsionDisposition].canUnfoild) {
|
||||
/// 闪屏广告跳转处理
|
||||
- (void)advertiseJumpHandleWithInfo:(AdvertiseModel *)info {
|
||||
if (![ClientConfig shareConfig].canOpen) {
|
||||
return;
|
||||
}
|
||||
if (UIApplication.sharedApplication.keyWindow != self.window) {
|
||||
|
||||
//当前窗口不是主控制器所在窗口时,拦截跳转(目前可能情况时,闪屏后出现新人引导
|
||||
return;
|
||||
}
|
||||
|
||||
switch (info.type) {
|
||||
case SplashAbstractSkipGenreRoom: {
|
||||
if (![[YUMIAdIndicateTool partowardsiciptowardsionIndictowardseUtensil] isImSurmount]) {
|
||||
return;
|
||||
case SplashInfoSkipTypeRoom: {
|
||||
if (![[XPAdImageTool shareImageTool] isImLogin]) {
|
||||
return; // 必须登录后才可以跳转
|
||||
}
|
||||
|
||||
// 跳转房间
|
||||
if (info.link.length > 0) {
|
||||
[YUMIChamberRegardGovernancer unfoildChamber:info.link viewController:[XCCurrentVCStackExecutive shareManager].getCurrentVC];
|
||||
[XPRoomViewController openRoom:info.link viewController:[XCCurrentVCStackManager shareManager].getCurrentVC];
|
||||
}
|
||||
}
|
||||
break;
|
||||
case SplashAbstractSkipGenreWeb: {
|
||||
|
||||
case SplashInfoSkipTypeWeb: {
|
||||
// 跳转 H5
|
||||
if (info.link.length > 0) {
|
||||
YUMITissueRegardGovernancer *webView = [[YUMITissueRegardGovernancer alloc]init];
|
||||
XPWebViewController *webView = [[XPWebViewController alloc]init];
|
||||
webView.url = info.link;
|
||||
[[[XCCurrentVCStackExecutive shareManager]universalBreeadcrumbGovernancer] pushViewController:webView animated:YES];
|
||||
[[[XCCurrentVCStackManager shareManager]currentNavigationController] pushViewController:webView animated:YES];
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
Reference in New Issue
Block a user