From a03efa8ae29def20b8b59689d9403b6a41a0486a Mon Sep 17 00:00:00 2001 From: wanghualei Date: Sat, 22 Apr 2023 11:23:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0iOS=20useNativeLiveComponent?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ios/Classes/Api/MOP_initSDK.m | 41 +++++++++++++++-------------------- ios/mop.podspec | 4 ++-- lib/mop.dart | 3 ++- 3 files changed, 22 insertions(+), 26 deletions(-) diff --git a/ios/Classes/Api/MOP_initSDK.m b/ios/Classes/Api/MOP_initSDK.m index eaf0047..7e98bce 100644 --- a/ios/Classes/Api/MOP_initSDK.m +++ b/ios/Classes/Api/MOP_initSDK.m @@ -73,6 +73,7 @@ NSError* error = nil; FATUIConfig *uiconfig = [[FATUIConfig alloc]init]; if (_uiConfig) { + // 导航栏配置 if (_uiConfig[@"navigationTitleTextAttributes"]) { uiconfig.navigationTitleTextAttributes = _uiConfig[@"navigationTitleTextAttributes"]; } @@ -90,28 +91,20 @@ if (_uiConfig[@"navigationBarBackBtnDarkColor"]) { uiconfig.navigationBarBackBtnDarkColor = [MOPTools colorWithRGBHex:[_uiConfig[@"navigationBarBackBtnDarkColor"] intValue]]; } + + // 更多视图配置 uiconfig.moreMenuStyle = [_uiConfig[@"moreMenuStyle"] integerValue]; uiconfig.hideBackToHomePriority = [_uiConfig[@"isHideBackHomePriority"] integerValue]; - uiconfig.hideFeedbackMenu = [_uiConfig[@"isHideFeedbackAndComplaints"] boolValue]; uiconfig.hideBackToHome = [_uiConfig[@"isHideBackHome"] boolValue]; - uiconfig.hideForwardMenu = [_uiConfig[@"isHideForwardMenu"] boolValue]; uiconfig.hideShareAppletMenu = [_uiConfig[@"isHideShareAppletMenu"] boolValue]; - uiconfig.hideRefreshMenu = [_uiConfig[@"isHideRefreshMenu"] boolValue]; - uiconfig.hideTransitionCloseButton = [_uiConfig[@"hideTransitionCloseButton"] boolValue]; - uiconfig.disableSlideCloseAppletGesture = [_uiConfig[@"disableSlideCloseAppletGesture"] boolValue]; - if (_uiConfig[@"webViewProgressBarColor"]) { - uiconfig.progressBarColor = [MOPTools colorWithRGBHex:[_uiConfig[@"webViewProgressBarColor"] intValue]]; - } - - uiconfig.hideFeedbackMenu = [_uiConfig[@"isHideFeedbackAndComplaints"] boolValue]; uiconfig.hideForwardMenu = [_uiConfig[@"isHideForwardMenu"] boolValue]; - uiconfig.autoAdaptDarkMode = [_uiConfig[@"autoAdaptDarkMode"] boolValue]; uiconfig.hideSettingMenu = [_uiConfig[@"isHideSettingMenu"] boolValue]; + uiconfig.hideFeedbackMenu = [_uiConfig[@"isHideFeedbackAndComplaints"] boolValue]; + uiconfig.hideRefreshMenu = [_uiConfig[@"isHideRefreshMenu"] boolValue]; uiconfig.hideFavoriteMenu = [_uiConfig[@"isHideFavoriteMenu"] boolValue]; uiconfig.hideAddToDesktopMenu = [_uiConfig[@"isHideAddToDesktopMenu"] boolValue]; - - uiconfig.appletText = _uiConfig[@"appletText"]; - uiconfig.disableSlideCloseAppletGesture = [_uiConfig[@"disableSlideCloseAppletGesture"] boolValue]; + + // 胶囊配置 if (_uiConfig[@"capsuleConfig"]) { NSDictionary *capsuleConfigDic = _uiConfig[@"capsuleConfig"]; FATCapsuleConfig *capsuleConfig = [[FATCapsuleConfig alloc]init]; @@ -133,8 +126,8 @@ capsuleConfig.capsuleDividerLightColor = [MOPTools colorWithRGBHex:[capsuleConfigDic[@"capsuleDividerLightColor"] intValue]]; capsuleConfig.capsuleDividerDarkColor = [MOPTools colorWithRGBHex:[capsuleConfigDic[@"capsuleDividerDarkColor"] intValue]]; uiconfig.capsuleConfig = capsuleConfig; - } + uiconfig.hideTransitionCloseButton = [_uiConfig[@"hideTransitionCloseButton"] boolValue]; if (_uiConfig[@"navHomeConfig"]) { NSDictionary *navHomeConfigDic = _uiConfig[@"navHomeConfig"]; @@ -243,15 +236,19 @@ uiconfig.authViewConfig = authViewConfig; } - uiconfig.appendingCustomUserAgent = _uiConfig[@"customWebViewUserAgent"]; - uiconfig.hideWebViewProgressBar = [_uiConfig[@"hideWebViewProgressBar"] boolValue]; - uiconfig.autoAdaptDarkMode = [_uiConfig[@"autoAdaptDarkMode"] boolValue]; uiconfig.transtionStyle = [_uiConfig[@"transtionStyle"] integerValue]; + uiconfig.disableSlideCloseAppletGesture = [_uiConfig[@"disableSlideCloseAppletGesture"] boolValue]; + if (_uiConfig[@"webViewProgressBarColor"]) { + uiconfig.progressBarColor = [MOPTools colorWithRGBHex:[_uiConfig[@"webViewProgressBarColor"] intValue]]; + } + uiconfig.hideWebViewProgressBar = [_uiConfig[@"hideWebViewProgressBar"] boolValue]; + + uiconfig.appletText = _uiConfig[@"appletText"]; + uiconfig.appendingCustomUserAgent = _uiConfig[@"customWebViewUserAgent"]; + uiconfig.autoAdaptDarkMode = [_uiConfig[@"autoAdaptDarkMode"] boolValue]; + uiConfig.useNativeLiveComponent = [_uiConfig[@"useNativeLiveComponent"] boolValue]; } - - - // uiconfig.moreMenuStyle = FATMoreViewStyleNormal; [[FATClient sharedClient] initWithConfig:config uiConfig:uiconfig error:&error]; if (error) { failure(@"初始化失败"); @@ -267,8 +264,6 @@ [[FATClient sharedClient].logManager initLogWithLogDir:logDir logLevel:logLevel consoleLog:YES]; } - - [[FATClient sharedClient] setEnableLog:YES]; success(@{}); diff --git a/ios/mop.podspec b/ios/mop.podspec index 475a335..a83d88e 100644 --- a/ios/mop.podspec +++ b/ios/mop.podspec @@ -17,7 +17,7 @@ A finclip miniprogram flutter sdk. s.dependency 'Flutter' s.ios.deployment_target = '9.0' - s.dependency 'FinApplet' , '2.40.3' - s.dependency 'FinAppletExt' , '2.40.3' + s.dependency 'FinApplet' , '2.40.4-dev20230422v01' + s.dependency 'FinAppletExt' , '2.40.4-dev20230422v01' end diff --git a/lib/mop.dart b/lib/mop.dart index cc35183..a579ca0 100644 --- a/lib/mop.dart +++ b/lib/mop.dart @@ -328,7 +328,8 @@ class UIConfig { // 是否自适应暗黑模式。如果设置为true,则更多页面、关于等原生页面会随着手机切换暗黑,也自动调整为暗黑模式 bool autoAdaptDarkMode = false; - // 是否使用内置的live组件 + // 是否使用内置的live组件,默认为false。(目前仅iOS支持) + // 配置为true时,需要依赖Live扩展SDK。 bool useNativeLiveComponent = false; // 要拼接的userAgent字符串