// // AppDelegate+SPSBConfiguration.m // 我的社保 // // Created by shanp on 2021/4/20. // #import "AppDelegate+SPSBConfiguration.h" #import "AppDelegate+SPSBRootViewController.h" #import "SPSBInfoSteamADManager.h" #import "YYKeychain.h" #import "SPSBKeyProfile.h" #import #import #import "SPSBKeyboardManager.h" #import "SPSBAppDifferenceProfile.h" #import #import #import #import #import "SPSBKeyProfile.h" #import #import "WXApi.h" #import #import #import "SPSBConstantProfile.h" #import "SPSBOpenADManager.h" #import "SPSBCustomerServiceManager.h" @interface AppDelegate () @end @implementation AppDelegate (SPSBConfiguration) - (void)localConfiguration { spsb_openADManager().spsb_switchStatus = SPSBOpenAdSwitchStatusUnknow; spsb_infoSteamAdManager().spsb_isShowSteamInfo = false; spsb_customerServiceManager().spsb_isChecking = false; spsb_customerServiceManager().spsb_notificationNum = 0; [self judgeIsFirstInstall]; [SPSBKeyboardManager shareManager]; [self creatDefinedTabbar]; } - (void)thirdPartConfiguration { [self SYConfiguration]; [self BUAdconfiguration]; [self baiduConfiguration]; [self zhichiConfiguration]; [self wechatConfiguration]; [self UMConfiguration]; [self shareFiguration]; } #pragma mark - 判断第一次安装 - (void)judgeIsFirstInstall { //保存一个唯一码 if (![YYKeychain getPasswordForService:SPSBJudgeFirstInstallKeychainServiece account:SPSBJudgeFirstInstallKeyKeychainAccount]) { NSString *UUID = jxh_getUUID(true); [YYKeychain setPassword:UUID forService:SPSBJudgeFirstInstallKeychainServiece account:SPSBJudgeFirstInstallKeyKeychainAccount]; debugLog(@"新加UUID"); } if (![jxh_userDefaults() objectForKey:SPSBVerifyCodeTime]) { //验证时间码标识符 //读取当前时间 - 60s NSDate* date = [NSDate dateWithTimeIntervalSinceNow:- 60]; NSString* dateString = [jxh_dateFormatter() stringFromDate:date]; [jxh_userDefaults() setObject:dateString forKey:SPSBVerifyCodeTime]; } //账号密码 [self setUserDefultsWithValue:@"" key:SPSBUserCode]; [self setUserDefultsWithValue:@"" key:SPSBUser]; [self setUserDefultsWithValue:@"" key:SPSBUserName]; [self setUserDefultsWithValue:@"1001" key:SPSBPurchaseCity]; [self setUserDefultsWithValue:@"1001" key:SPSBPurchaseDataCity]; [self setUserDefultsWithValue:@"400-062-2002" key:SPSBCustomerServicePhone]; [self setUserDefultsWithValue:@[] key:SPSBBarImageList]; [self setUserDefultsWithValue:@"2015-10-01 00:00:00" key:SPSBShebaoNormalRefreshTime]; [self setUserDefultsWithValue:@"2016-09-22 00:00:00" key:SPSBShebaoSupplementaryPayRefreshTime]; [self setUserDefultsWithValue:@{@"query" : @"1", @"home": @"0"} key:SPSBTipsMark]; [jxh_userDefaults() synchronize]; } - (void)setUserDefultsWithValue:(id)value key:(NSString *)key { if (![jxh_userDefaults() objectForKey:key]) { [jxh_userDefaults() setObject:value forKey:key]; } } #pragma mark - 微信 - (void)wechatConfiguration { [WXApi registerApp:SPSBWeChatAppKey universalLink:SPSBUniversalLink]; } #pragma mark - Share - (void)shareFiguration { [MobSDK uploadPrivacyPermissionStatus:true onResult:^(BOOL success) { }]; [ShareSDK registPlatforms:^(SSDKRegister *platformsRegister) { [platformsRegister setupSinaWeiboWithAppkey:SPSBSinaWeiboAppKey appSecret:SPSBSinaWeiboAppSecret redirectUrl:SPSBSinaWeiboRedirectUri universalLink:SPSBUniversalLink]; [platformsRegister setupWeChatWithAppId:SPSBWeChatAppKey appSecret:SPSBWeChatAppSecret universalLink:SPSBUniversalLink]; [platformsRegister setupQQWithAppId:SPSBQQAppKey appkey:SPSBQQAppSecret enableUniversalLink:true universalLink:SPSBUniversalLink]; }]; } #pragma mark - 智齿 - (void)zhichiConfiguration { // 添加用户画像 [[ZCLibClient getZCLibClient] initSobotSDK:SPSBSobotAppKey host:nil result:^(id object) { }]; // 是否自动提醒 [[ZCLibClient getZCLibClient] setAutoNotification:true]; #ifdef DEBUG [[ZCLibClient getZCLibClient] setIsDebugMode:true]; #endif // 错误日志收集 [ZCLibClient setZCLibUncaughtExceptionHandler]; } #pragma mark - 百度定位 - (void)baiduConfiguration { [[BMKLocationAuth sharedInstance] checkPermisionWithKey:SPSBBaiduKey authDelegate:self]; } #pragma mark - 闪验 - (void)SYConfiguration { [CLShanYanSDKManager initWithAppId:@"WGc6f7Ie" complete:^(CLCompleteResult * _Nonnull completeResult) { //预取号 [CLShanYanSDKManager preGetPhonenumber:nil]; }]; } #pragma mark - 友盟 - (void)UMConfiguration { [UMConfigure initWithAppkey:SPSBUMAppKey channel:@"App Store"]; #ifdef DEBUG [UMConfigure setLogEnabled:true]; [UMConfigure setAnalyticsEnabled:false]; #endif } #pragma mark - 穿山甲 - (void)BUAdconfiguration { [BUAdSDKManager setAppID:@"5328072"]; debugLog(@"-----------%@", [BUAdSDKManager SDKVersion]); // [BUAdSDKManager setIsPaidApp:false]; #if DEBUG //Whether to open log. default is none. // [BUAdSDKManager setLoglevel:BUAdSDKLogLevelDebug]; #endif } @end