Commit 2fddb6c9 by pierce

修复启动卡顿的问题

parent 0f4e428a
......@@ -187,7 +187,7 @@
self.enableHttpDebug = false;
self.enableDBDebug = false;
self.enableEaseMobChange = false;
self.enableCrash = false;
self.enableCrash = true;
self.enableCustomAddress = false;
break;
......
......@@ -139,18 +139,20 @@ NSString * const FUSSocializedIsSafariLoginKey = @"FUSSocializedIsSafariLoginKey
- (void)fus_setupAbroadSocializedHelperWithApplication:(UIApplication *)application
Options:(NSDictionary *)options
{
dispatch_async(dispatch_get_global_queue(0, 0), ^{
// 配置 google
[self setupGoogle];
// 配置 Facebook
[self setupFacebookWithApplication:application
Options:options];
});
// 配置 Twitter
[self setupTwitter];
// [self setupTwitter];
//配置 line
[self setupLine];
// [self setupLine];
}
/**
......
......@@ -46,14 +46,16 @@ static NSString *const kGtAppSecret = @"OSSSWqbWY0ACJiUv4AHdW7";
// 通过 个推平台 分配的appId、 appKey 、appSecret 启动SDK,注:该方法需要在主线程中调用
[GeTuiSdk startSdkWithAppId:kGtAppId appKey:kGtAppKey appSecret:kGtAppSecret delegate:self launchingOptions:launchOptions];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[FIRApp configure];
[FIRAnalytics setAnalyticsCollectionEnabled:YES];
[self checkPasteboard];
// 初始化TalkingData统计
[FUSTalkingData fus_sessionStarted:FUSConfig.sharedInstanced.sdkConfigs.talkingData withChannelId:[FUSDeviceHelper fus_getChannelId]];
[FUSTalkingData fus_setExceptionReportEnabled:YES];
});
[self checkPasteboard];
// 获取域名
[FUSAPIDNSManager fus_checkCurrentDNSAddress];
......
......@@ -153,6 +153,19 @@
}
- (void)fus_loginSuccess {
// 开发环境下可切换环信 Key,默认为正式 Key
if (FUSConfig.sharedInstanced.devConfigs.enableEaseMobChange) {
// 可修改,使用当前存储的 Key
NSString *currentKey = [[NSUserDefaults standardUserDefaults] objectForKey:FUSChatUDKeys.fus_CURRENT_EASE_MOB_KEY];
if ([NSString isNull:currentKey]) {
currentKey = FUSConfig.sharedInstanced.sdkConfigs.easeMobAppKey;
}
// 初始化环信SDK
[[FUSIMChatService shareInstance] fus_initEaseMobSDKWithAppKey:currentKey];
} else {
// 初始化环信SDK
[[FUSIMChatService shareInstance] fus_initEaseMobSDKWithAppKey:FUSConfig.sharedInstanced.sdkConfigs.easeMobAppKey];
}
}
......@@ -468,20 +481,6 @@
#pragma mark - UIApplicationDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey,id> *)launchOptions {
// 开发环境下可切换环信 Key,默认为正式 Key
if (FUSConfig.sharedInstanced.devConfigs.enableEaseMobChange) {
// 可修改,使用当前存储的 Key
NSString *currentKey = [[NSUserDefaults standardUserDefaults] objectForKey:FUSChatUDKeys.fus_CURRENT_EASE_MOB_KEY];
if ([NSString isNull:currentKey]) {
currentKey = FUSConfig.sharedInstanced.sdkConfigs.easeMobAppKey;
}
// 初始化环信SDK
[[FUSIMChatService shareInstance] fus_initEaseMobSDKWithAppKey:currentKey];
} else {
// 初始化环信SDK
[[FUSIMChatService shareInstance] fus_initEaseMobSDKWithAppKey:FUSConfig.sharedInstanced.sdkConfigs.easeMobAppKey];
}
return YES;
}
......
......@@ -169,6 +169,8 @@
- (void)fus_logSuccess {
[self initTTSDK];
//拉取直播文字链资源
[FUSLiveHttpHelper fus_requestCharacterHyperlinkData];
......@@ -436,7 +438,6 @@
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary<UIApplicationLaunchOptionsKey,id> *)launchOptions {
[self fus_setupLiveConfig];
[self initTTSDK];
[self fus_setupRemoutePushWithOptions:launchOptions];
return YES;
......
......@@ -41,7 +41,7 @@
#define BG_VIEW_STAYDURATION 5
@interface FUSStartPageViewController () <CLLocationManagerDelegate,ASAuthorizationControllerDelegate,ASAuthorizationControllerPresentationContextProviding>
@interface FUSStartPageViewController () <ASAuthorizationControllerDelegate,ASAuthorizationControllerPresentationContextProviding>
@property (strong, nonatomic) IBOutlet UIImageView *bgImageView;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment