2023-03-19 11:51:51 +08:00
|
|
|
//
|
|
|
|
// Mop_newInitialize.m
|
|
|
|
// mop
|
|
|
|
//
|
|
|
|
// Created by 滔 on 2023/3/17.
|
|
|
|
//
|
|
|
|
|
2023-03-21 15:58:07 +08:00
|
|
|
#import "Mop_initSDK.h"
|
2023-03-19 11:51:51 +08:00
|
|
|
#import "MOPTools.h"
|
2024-03-13 17:54:28 +08:00
|
|
|
#import "FinAppletExt.h"
|
2023-03-19 11:51:51 +08:00
|
|
|
|
2023-03-21 15:58:07 +08:00
|
|
|
@implementation MOP_initSDK
|
2023-03-19 11:51:51 +08:00
|
|
|
|
|
|
|
- (void)setupApiWithSuccess:(void (^)(NSDictionary<NSString *,id> * _Nonnull))success failure:(void (^)(id _Nullable))failure cancel:(void (^)(void))cancel
|
|
|
|
{
|
|
|
|
if (!self.config) {
|
|
|
|
failure(@"config不能为空");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
FATConfig *config;
|
2023-03-21 17:46:50 +08:00
|
|
|
NSArray *storeConfigList = self.config[@"finStoreConfigs"];
|
2023-03-19 11:51:51 +08:00
|
|
|
if (storeConfigList && storeConfigList.count > 0) {
|
|
|
|
NSMutableArray *storeArrayM = [NSMutableArray array];
|
|
|
|
for (NSDictionary *dict in storeConfigList) {
|
|
|
|
FATStoreConfig *storeConfig = [[FATStoreConfig alloc] init];
|
|
|
|
storeConfig.sdkKey = dict[@"sdkKey"];
|
|
|
|
storeConfig.sdkSecret = dict[@"sdkSecret"];
|
|
|
|
storeConfig.apiServer = dict[@"apiServer"];
|
|
|
|
storeConfig.apmServer = dict[@"apmServer"];
|
|
|
|
storeConfig.fingerprint = dict[@"fingerprint"];
|
|
|
|
if ([@"SM" isEqualToString:dict[@"cryptType"]]) {
|
|
|
|
storeConfig.cryptType = FATApiCryptTypeSM;
|
|
|
|
} else {
|
|
|
|
storeConfig.cryptType = FATApiCryptTypeMD5;
|
|
|
|
}
|
|
|
|
storeConfig.encryptServerData = [dict[@"encryptServerData"] boolValue];
|
2023-06-14 21:56:28 +08:00
|
|
|
storeConfig.enablePreloadFramework = [storeConfig.apiServer isEqualToString:@"https://api.finclip.com"];
|
2023-03-19 11:51:51 +08:00
|
|
|
[storeArrayM addObject:storeConfig];
|
2023-12-06 16:26:53 +08:00
|
|
|
|
|
|
|
//google map key
|
|
|
|
[[FATExtClient sharedClient] registerGoogleMapService:dict[@"googleMapApiKey"] placesKey:dict[@"googleMapApiKey"]];
|
2023-03-19 11:51:51 +08:00
|
|
|
}
|
|
|
|
config = [FATConfig configWithStoreConfigs:storeArrayM];
|
|
|
|
} else {
|
|
|
|
failure(@"storeConfigs不能为空");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-03-21 17:46:50 +08:00
|
|
|
config.currentUserId = self.config[@"userId"];
|
2024-08-21 09:26:56 +08:00
|
|
|
config.channel = self.config[@"channel"];
|
|
|
|
config.phone = self.config[@"phone"];
|
2023-03-19 11:51:51 +08:00
|
|
|
config.productIdentification = self.config[@"productIdentification"];
|
2023-03-21 17:46:50 +08:00
|
|
|
config.disableAuthorize = [self.config[@"disableRequestPermissions"] boolValue];
|
2023-03-19 11:51:51 +08:00
|
|
|
config.appletAutoAuthorize = [self.config[@"appletAutoAuthorize"] boolValue];
|
|
|
|
config.disableGetSuperviseInfo = [self.config[@"disableGetSuperviseInfo"] boolValue];
|
|
|
|
config.ignoreWebviewCertAuth = [self.config[@"ignoreWebviewCertAuth"] boolValue];
|
|
|
|
config.appletIntervalUpdateLimit = [self.config[@"appletIntervalUpdateLimit"] integerValue];
|
|
|
|
config.startCrashProtection = [self.config[@"startCrashProtection"] boolValue];
|
|
|
|
config.enableApmDataCompression = [self.config[@"enableApmDataCompression"] boolValue];
|
|
|
|
config.encryptServerData = [self.config[@"encryptServerData"] boolValue];
|
2023-03-21 17:46:50 +08:00
|
|
|
config.enableAppletDebug = [self.config[@"appletDebugMode"] integerValue];
|
2023-03-19 11:51:51 +08:00
|
|
|
config.enableWatermark = [self.config[@"enableWatermark"] boolValue];
|
|
|
|
config.watermarkPriority = [self.config[@"watermarkPriority"] integerValue];
|
|
|
|
config.baseLoadingViewClass = self.config[@"baseLoadingViewClass"];
|
|
|
|
config.baseLoadFailedViewClass = self.config[@"baseLoadFailedViewClass"];
|
|
|
|
config.header = self.config[@"header"];
|
|
|
|
config.headerPriority = [self.config[@"headerPriority"] integerValue];
|
|
|
|
config.enableH5AjaxHook = [self.config[@"enableH5AjaxHook"] boolValue];
|
|
|
|
config.h5AjaxHookRequestKey = self.config[@"h5AjaxHookRequestKey"];
|
|
|
|
config.pageCountLimit = [self.config[@"pageCountLimit"] integerValue];
|
|
|
|
config.schemes = self.config[@"schemes"];
|
2023-12-25 14:45:49 +08:00
|
|
|
config.webViewInspectable = [self.config[@"debug"] boolValue];
|
2023-04-07 21:40:02 +08:00
|
|
|
NSInteger languageInteger = [self.config[@"language"] integerValue];
|
2024-03-13 17:25:01 +08:00
|
|
|
if (self.config[@"backgroundFetchPeriod"]) {
|
|
|
|
config.backgroundFetchPeriod = [self.config[@"backgroundFetchPeriod"] integerValue];
|
|
|
|
}
|
2023-04-07 21:40:02 +08:00
|
|
|
if (languageInteger == 1) {
|
|
|
|
config.language = FATPreferredLanguageEnglish;
|
|
|
|
} else {
|
|
|
|
config.language = FATPreferredLanguageSimplifiedChinese;
|
|
|
|
}
|
2023-12-06 13:57:15 +08:00
|
|
|
config.customLanguagePath = self.config[@"customLanguagePath"];
|
|
|
|
|
2023-03-19 11:51:51 +08:00
|
|
|
NSError* error = nil;
|
|
|
|
FATUIConfig *uiconfig = [[FATUIConfig alloc]init];
|
|
|
|
if (_uiConfig) {
|
2023-04-22 11:23:47 +08:00
|
|
|
// 导航栏配置
|
2023-03-19 11:51:51 +08:00
|
|
|
if (_uiConfig[@"navigationTitleTextAttributes"]) {
|
|
|
|
uiconfig.navigationTitleTextAttributes = _uiConfig[@"navigationTitleTextAttributes"];
|
|
|
|
}
|
|
|
|
|
|
|
|
uiconfig.navigationBarHeight = [_uiConfig[@"navigationBarHeight"] floatValue];
|
|
|
|
if (_uiConfig[@"navigationBarTitleLightColor"]) {
|
|
|
|
uiconfig.navigationBarTitleLightColor = [MOPTools colorWithRGBHex:[_uiConfig[@"navigationBarTitleLightColor"] intValue]];
|
|
|
|
}
|
|
|
|
if (_uiConfig[@"navigationBarTitleDarkColor"]) {
|
|
|
|
uiconfig.navigationBarTitleDarkColor = [MOPTools colorWithRGBHex:[_uiConfig[@"navigationBarTitleDarkColor"] intValue]];
|
|
|
|
}
|
|
|
|
if (_uiConfig[@"navigationBarBackBtnLightColor"]) {
|
|
|
|
uiconfig.navigationBarBackBtnLightColor = [MOPTools colorWithRGBHex:[_uiConfig[@"navigationBarBackBtnLightColor"] intValue]];
|
|
|
|
}
|
|
|
|
if (_uiConfig[@"navigationBarBackBtnDarkColor"]) {
|
|
|
|
uiconfig.navigationBarBackBtnDarkColor = [MOPTools colorWithRGBHex:[_uiConfig[@"navigationBarBackBtnDarkColor"] intValue]];
|
|
|
|
}
|
2023-04-22 11:23:47 +08:00
|
|
|
|
|
|
|
// 更多视图配置
|
2023-03-19 11:51:51 +08:00
|
|
|
uiconfig.moreMenuStyle = [_uiConfig[@"moreMenuStyle"] integerValue];
|
2023-03-21 17:46:50 +08:00
|
|
|
uiconfig.hideBackToHomePriority = [_uiConfig[@"isHideBackHomePriority"] integerValue];
|
2023-03-19 11:51:51 +08:00
|
|
|
uiconfig.hideBackToHome = [_uiConfig[@"isHideBackHome"] boolValue];
|
2023-03-20 10:43:14 +08:00
|
|
|
uiconfig.hideShareAppletMenu = [_uiConfig[@"isHideShareAppletMenu"] boolValue];
|
2023-03-19 11:51:51 +08:00
|
|
|
uiconfig.hideForwardMenu = [_uiConfig[@"isHideForwardMenu"] boolValue];
|
2023-03-22 16:17:23 +08:00
|
|
|
uiconfig.hideSettingMenu = [_uiConfig[@"isHideSettingMenu"] boolValue];
|
2023-04-22 11:23:47 +08:00
|
|
|
uiconfig.hideFeedbackMenu = [_uiConfig[@"isHideFeedbackAndComplaints"] boolValue];
|
|
|
|
uiconfig.hideRefreshMenu = [_uiConfig[@"isHideRefreshMenu"] boolValue];
|
2023-03-24 10:46:28 +08:00
|
|
|
uiconfig.hideFavoriteMenu = [_uiConfig[@"isHideFavoriteMenu"] boolValue];
|
|
|
|
uiconfig.hideAddToDesktopMenu = [_uiConfig[@"isHideAddToDesktopMenu"] boolValue];
|
2024-03-13 17:25:01 +08:00
|
|
|
uiconfig.hideClearCacheMenu = [_uiConfig[@"isHideClearCacheMenu"] boolValue];
|
2023-04-22 11:23:47 +08:00
|
|
|
|
|
|
|
// 胶囊配置
|
2023-03-19 11:51:51 +08:00
|
|
|
if (_uiConfig[@"capsuleConfig"]) {
|
|
|
|
NSDictionary *capsuleConfigDic = _uiConfig[@"capsuleConfig"];
|
|
|
|
FATCapsuleConfig *capsuleConfig = [[FATCapsuleConfig alloc]init];
|
|
|
|
capsuleConfig.capsuleWidth = [capsuleConfigDic[@"capsuleWidth"] floatValue];
|
|
|
|
capsuleConfig.capsuleHeight = [capsuleConfigDic[@"capsuleHeight"] floatValue];
|
|
|
|
capsuleConfig.capsuleRightMargin = [capsuleConfigDic[@"capsuleRightMargin"] floatValue];
|
|
|
|
capsuleConfig.capsuleCornerRadius = [capsuleConfigDic[@"capsuleCornerRadius"] floatValue];
|
|
|
|
capsuleConfig.capsuleBorderWidth = [capsuleConfigDic[@"capsuleBorderWidth"] floatValue];
|
|
|
|
capsuleConfig.moreBtnWidth = [capsuleConfigDic[@"moreBtnWidth"] floatValue];
|
|
|
|
capsuleConfig.moreBtnLeftMargin = [capsuleConfigDic[@"moreBtnLeftMargin"] floatValue];
|
|
|
|
capsuleConfig.closeBtnWidth = [capsuleConfigDic[@"closeBtnWidth"] floatValue];
|
|
|
|
capsuleConfig.closeBtnLeftMargin = [capsuleConfigDic[@"closeBtnLeftMargin"] floatValue];
|
|
|
|
|
|
|
|
|
|
|
|
capsuleConfig.capsuleBorderLightColor = [MOPTools colorWithRGBHex:[capsuleConfigDic[@"capsuleBorderLightColor"] intValue]];
|
|
|
|
capsuleConfig.capsuleBorderDarkColor = [MOPTools colorWithRGBHex:[capsuleConfigDic[@"capsuleBorderDarkColor"] intValue]];
|
|
|
|
capsuleConfig.capsuleBgLightColor = [MOPTools colorWithRGBHex:[capsuleConfigDic[@"capsuleBgLightColor"] intValue]];
|
|
|
|
capsuleConfig.capsuleBgDarkColor = [MOPTools colorWithRGBHex:[capsuleConfigDic[@"capsuleBgDarkColor"] intValue]];
|
|
|
|
capsuleConfig.capsuleDividerLightColor = [MOPTools colorWithRGBHex:[capsuleConfigDic[@"capsuleDividerLightColor"] intValue]];
|
|
|
|
capsuleConfig.capsuleDividerDarkColor = [MOPTools colorWithRGBHex:[capsuleConfigDic[@"capsuleDividerDarkColor"] intValue]];
|
|
|
|
uiconfig.capsuleConfig = capsuleConfig;
|
|
|
|
}
|
2023-04-22 11:23:47 +08:00
|
|
|
uiconfig.hideTransitionCloseButton = [_uiConfig[@"hideTransitionCloseButton"] boolValue];
|
2023-03-20 10:43:14 +08:00
|
|
|
|
|
|
|
if (_uiConfig[@"navHomeConfig"]) {
|
|
|
|
NSDictionary *navHomeConfigDic = _uiConfig[@"navHomeConfig"];
|
|
|
|
FATNavHomeConfig *navHomeConfig = [[FATNavHomeConfig alloc]init];
|
|
|
|
navHomeConfig.width = [navHomeConfigDic[@"width"] floatValue];
|
|
|
|
navHomeConfig.height = [navHomeConfigDic[@"height"] floatValue];
|
|
|
|
navHomeConfig.leftMargin = [navHomeConfigDic[@"leftMargin"] floatValue];
|
|
|
|
navHomeConfig.cornerRadius = [navHomeConfigDic[@"cornerRadius"] floatValue];
|
|
|
|
navHomeConfig.borderWidth = [navHomeConfigDic[@"width"] floatValue];
|
|
|
|
if (navHomeConfigDic[@"borderLightColor"]) {
|
|
|
|
navHomeConfig.borderLightColor = [MOPTools colorWithRGBHex:[navHomeConfigDic[@"borderLightColor"] intValue]];
|
|
|
|
}
|
|
|
|
if (navHomeConfigDic[@"borderDarkColor"]) {
|
|
|
|
navHomeConfig.borderDarkColor = [MOPTools colorWithRGBHex:[navHomeConfigDic[@"borderDarkColor"] intValue]];
|
|
|
|
}
|
|
|
|
if (navHomeConfigDic[@"bgLightColor"]) {
|
|
|
|
navHomeConfig.bgLightColor = [MOPTools colorWithRGBHex:[navHomeConfigDic[@"bgLightColor"] intValue]];
|
|
|
|
}
|
|
|
|
if (navHomeConfigDic[@"bgDarkColor"]) {
|
|
|
|
navHomeConfig.bgDarkColor = [MOPTools colorWithRGBHex:[navHomeConfigDic[@"bgDarkColor"] intValue]];
|
|
|
|
}
|
|
|
|
uiconfig.navHomeConfig = navHomeConfig;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (_uiConfig[@"authViewConfig"]) {
|
|
|
|
NSDictionary *authViewConfigDic = _uiConfig[@"authViewConfig"];
|
|
|
|
FATAuthViewConfig *authViewConfig = [[FATAuthViewConfig alloc]init];
|
2023-03-21 17:46:50 +08:00
|
|
|
authViewConfig.appletNameFont = [UIFont systemFontOfSize:[authViewConfigDic[@"appletNameTextSize"] floatValue]];
|
2023-03-20 10:43:14 +08:00
|
|
|
if (authViewConfigDic[@"appletNameLightColor"]) {
|
|
|
|
authViewConfig.appletNameLightColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"appletNameLightColor"] intValue]];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (authViewConfigDic[@"appletNameDarkColor"]) {
|
|
|
|
authViewConfig.appletNameDarkColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"appletNameDarkColor"] intValue]];
|
|
|
|
}
|
|
|
|
|
2023-03-21 17:46:50 +08:00
|
|
|
authViewConfig.authorizeTitleFont = [UIFont systemFontOfSize:[authViewConfigDic[@"authorizeTitleTextSize"] floatValue] weight:UIFontWeightMedium];
|
2023-03-20 10:43:14 +08:00
|
|
|
|
|
|
|
if (authViewConfigDic[@"authorizeTitleLightColor"]) {
|
|
|
|
authViewConfig.authorizeTitleLightColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"authorizeTitleLightColor"] intValue]];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (authViewConfigDic[@"authorizeTitleDarkColor"]) {
|
|
|
|
authViewConfig.authorizeTitleDarkColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"authorizeTitleDarkColor"] intValue]];
|
|
|
|
}
|
|
|
|
|
2023-03-21 17:46:50 +08:00
|
|
|
authViewConfig.authorizeDescriptionFont = [UIFont systemFontOfSize:[authViewConfigDic[@"authorizeDescriptionTextSize"] floatValue]];
|
2023-03-20 10:43:14 +08:00
|
|
|
|
|
|
|
if (authViewConfigDic[@"authorizeDescriptionLightColor"]) {
|
|
|
|
authViewConfig.authorizeDescriptionLightColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"authorizeDescriptionLightColor"] intValue]];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (authViewConfigDic[@"authorizeDescriptionDarkColor"]) {
|
|
|
|
authViewConfig.authorizeDescriptionDarkColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"authorizeDescriptionDarkColor"] intValue]];
|
|
|
|
}
|
|
|
|
|
2023-03-21 17:46:50 +08:00
|
|
|
authViewConfig.agreementTitleFont = [UIFont systemFontOfSize:[authViewConfigDic[@"agreementTitleTextSize"] floatValue]];
|
2023-03-20 10:43:14 +08:00
|
|
|
|
|
|
|
if (authViewConfigDic[@"agreementTitleLightColor"]) {
|
|
|
|
authViewConfig.agreementTitleLightColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"agreementTitleLightColor"] intValue]];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (authViewConfigDic[@"agreementTitleDarkColor"]) {
|
|
|
|
authViewConfig.agreementTitleDarkColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"agreementTitleDarkColor"] intValue]];
|
|
|
|
}
|
|
|
|
|
2023-03-21 17:46:50 +08:00
|
|
|
authViewConfig.agreementDescriptionFont = [UIFont systemFontOfSize:[authViewConfigDic[@"agreementDescriptionTextSize"] floatValue]];
|
2023-03-20 10:43:14 +08:00
|
|
|
|
|
|
|
if (authViewConfigDic[@"agreementDescriptionLightColor"]) {
|
|
|
|
authViewConfig.agreementDescriptionLightColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"agreementDescriptionLightColor"] intValue]];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (authViewConfigDic[@"agreementDescriptionDarkColor"]) {
|
|
|
|
authViewConfig.agreementDescriptionDarkColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"agreementDescriptionDarkColor"] intValue]];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (authViewConfigDic[@"linkLightColor"]) {
|
|
|
|
authViewConfig.linkLightColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"linkLightColor"] intValue]];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (authViewConfigDic[@"linkDarkColor"]) {
|
|
|
|
authViewConfig.linkDarkColor = [MOPTools colorWithRGBHex:[authViewConfigDic[@"linkDarkColor"] intValue]];
|
|
|
|
}
|
|
|
|
|
|
|
|
if (authViewConfigDic[@"allowButtonLightConfig"]) {
|
|
|
|
FATAuthButtonConfig *allowButtonLightConfig = [self createAuthButtonConfigWithDic:authViewConfigDic[@"allowButtonLightConfig"]];
|
|
|
|
authViewConfig.allowButtonLightConfig = allowButtonLightConfig;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (authViewConfigDic[@"allowButtonDarkConfig"]) {
|
|
|
|
FATAuthButtonConfig *allowButtonDarkConfig = [self createAuthButtonConfigWithDic:authViewConfigDic[@"allowButtonDarkConfig"]];
|
|
|
|
authViewConfig.allowButtonDarkConfig = allowButtonDarkConfig;
|
|
|
|
|
|
|
|
}
|
|
|
|
if (authViewConfigDic[@"rejectButtonLightConfig"]) {
|
|
|
|
FATAuthButtonConfig *rejectButtonLightConfig = [self createAuthButtonConfigWithDic:authViewConfigDic[@"rejectButtonLightConfig"]];
|
|
|
|
authViewConfig.rejectButtonLightConfig = rejectButtonLightConfig;
|
|
|
|
|
|
|
|
}
|
|
|
|
if (authViewConfigDic[@"rejectButtonDarkConfig"]) {
|
|
|
|
FATAuthButtonConfig *rejectButtonDarkConfig = [self createAuthButtonConfigWithDic:authViewConfigDic[@"rejectButtonDarkConfig"]];
|
|
|
|
authViewConfig.rejectButtonDarkConfig = rejectButtonDarkConfig;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
uiconfig.authViewConfig = authViewConfig;
|
|
|
|
}
|
2023-04-22 11:23:47 +08:00
|
|
|
uiconfig.transtionStyle = [_uiConfig[@"transtionStyle"] integerValue];
|
|
|
|
uiconfig.disableSlideCloseAppletGesture = [_uiConfig[@"disableSlideCloseAppletGesture"] boolValue];
|
|
|
|
if (_uiConfig[@"webViewProgressBarColor"]) {
|
|
|
|
uiconfig.progressBarColor = [MOPTools colorWithRGBHex:[_uiConfig[@"webViewProgressBarColor"] intValue]];
|
|
|
|
}
|
2023-03-20 10:43:14 +08:00
|
|
|
uiconfig.hideWebViewProgressBar = [_uiConfig[@"hideWebViewProgressBar"] boolValue];
|
2023-04-22 11:23:47 +08:00
|
|
|
|
|
|
|
uiconfig.appletText = _uiConfig[@"appletText"];
|
|
|
|
uiconfig.appendingCustomUserAgent = _uiConfig[@"customWebViewUserAgent"];
|
2023-03-20 10:43:14 +08:00
|
|
|
uiconfig.autoAdaptDarkMode = [_uiConfig[@"autoAdaptDarkMode"] boolValue];
|
2023-04-22 11:33:38 +08:00
|
|
|
uiconfig.useNativeLiveComponent = [_uiConfig[@"useNativeLiveComponent"] boolValue];
|
2023-03-19 11:51:51 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
[[FATClient sharedClient] initWithConfig:config uiConfig:uiconfig error:&error];
|
|
|
|
if (error) {
|
|
|
|
failure(@"初始化失败");
|
|
|
|
return;
|
|
|
|
}
|
2023-03-23 11:45:52 +08:00
|
|
|
|
2023-12-25 14:45:49 +08:00
|
|
|
int logMaxAliveSec = [self.config[@"logMaxAliveSec"] intValue];
|
|
|
|
if (logMaxAliveSec) {
|
|
|
|
[[FATClient sharedClient].logManager setLogFileAliveDuration:logMaxAliveSec];
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL debug = [self.config[@"debug"] boolValue];
|
2023-03-23 11:45:52 +08:00
|
|
|
NSInteger logLevelIntValue = [self.config[@"logLevel"] integerValue];
|
2023-12-25 14:45:49 +08:00
|
|
|
if (debug && logLevelIntValue < 5) {
|
2023-03-23 11:45:52 +08:00
|
|
|
FATLogLevel logLevel = logLevelIntValue;
|
|
|
|
NSString *logDir = self.config[@"logDir"];
|
|
|
|
[[FATClient sharedClient].logManager initLogWithLogDir:logDir logLevel:logLevel consoleLog:YES];
|
2023-12-25 14:45:49 +08:00
|
|
|
} else {
|
|
|
|
[FATClient sharedClient].enableLog = NO;
|
2023-03-23 11:45:52 +08:00
|
|
|
}
|
|
|
|
|
2023-03-19 11:51:51 +08:00
|
|
|
success(@{});
|
|
|
|
|
|
|
|
}
|
2023-03-20 10:43:14 +08:00
|
|
|
|
|
|
|
- (FATAuthButtonConfig *)createAuthButtonConfigWithDic:(NSDictionary *)dic {
|
|
|
|
if (!dic) {
|
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
FATAuthButtonConfig * authButtonConfig = [[FATAuthButtonConfig alloc]init];
|
|
|
|
if (dic[@"cornerRadius"]) {
|
|
|
|
authButtonConfig.cornerRadius = [dic[@"cornerRadius"] floatValue];
|
|
|
|
}
|
|
|
|
if (dic[@"normalBackgroundColor"]) {
|
|
|
|
authButtonConfig.normalBackgroundColor = [MOPTools colorWithRGBHex:[dic[@"normalBackgroundColor"] intValue]];
|
|
|
|
}
|
|
|
|
if (dic[@"pressedBackgroundColor"]) {
|
|
|
|
authButtonConfig.pressedBackgroundColor = [MOPTools colorWithRGBHex:[dic[@"pressedBackgroundColor"] intValue]];
|
|
|
|
}
|
|
|
|
if (dic[@"normalTextColor"]) {
|
|
|
|
authButtonConfig.normalTextColor = [MOPTools colorWithRGBHex:[dic[@"normalTextColor"] intValue]];
|
|
|
|
}
|
|
|
|
if (dic[@"pressedTextColor"]) {
|
|
|
|
authButtonConfig.pressedTextColor = [MOPTools colorWithRGBHex:[dic[@"pressedTextColor"] intValue]];
|
|
|
|
}
|
|
|
|
if (dic[@"normalBorderColor"]) {
|
|
|
|
authButtonConfig.normalBorderColor = [MOPTools colorWithRGBHex:[dic[@"normalBorderColor"] intValue]];
|
|
|
|
}
|
|
|
|
if (dic[@"pressedBorderColor"]) {
|
|
|
|
authButtonConfig.pressedBorderColor = [MOPTools colorWithRGBHex:[dic[@"pressedBorderColor"] intValue]];
|
|
|
|
}
|
|
|
|
|
|
|
|
return authButtonConfig;
|
|
|
|
}
|
2023-03-19 11:51:51 +08:00
|
|
|
@end
|