diff --git a/CHANGELOG.md b/CHANGELOG.md index 685db82a..0be55b02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ The changelog for [Kommunicate-iOS-SDK](https://github.com/Kommunicate-io/Kommunicate-iOS-SDK). Also see the [releases](https://github.com/Kommunicate-io/Kommunicate-iOS-SDK/releases) on Github. +## [7.0.9] 2023-12-12 +- Fixed hidePostCTA message delete issue. + ## [7.0.8] 2023-12-06 - Added Support of Video Rich Message. - Fixed the attachment upload issue. diff --git a/Example/Podfile.lock b/Example/Podfile.lock index ed4198ff..f215c071 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -6,18 +6,18 @@ PODS: - iOSSnapshotTestCase/SwiftSupport (8.0.0): - iOSSnapshotTestCase/Core - Kingfisher (7.6.2) - - Kommunicate (7.0.8): - - KommunicateChatUI-iOS-SDK (~> 1.2.3) - - KommunicateChatUI-iOS-SDK (1.2.3): - - KommunicateChatUI-iOS-SDK/Complete (= 1.2.3) - - KommunicateChatUI-iOS-SDK/Complete (1.2.3): + - Kommunicate (7.0.9): + - KommunicateChatUI-iOS-SDK (~> 1.2.4) + - KommunicateChatUI-iOS-SDK (1.2.4): + - KommunicateChatUI-iOS-SDK/Complete (= 1.2.4) + - KommunicateChatUI-iOS-SDK/Complete (1.2.4): - iOSDropDown - Kingfisher (~> 7.6.2) - KommunicateChatUI-iOS-SDK/RichMessageKit - KommunicateCore-iOS-SDK (~> 1.1.5) - SwipeCellKit (~> 2.7.1) - ZendeskChatProvidersSDK (~> 3.0.0) - - KommunicateChatUI-iOS-SDK/RichMessageKit (1.2.3) + - KommunicateChatUI-iOS-SDK/RichMessageKit (1.2.4) - KommunicateCore-iOS-SDK (1.1.5) - Nimble (12.3.0) - Nimble-Snapshots (9.6.1): @@ -57,8 +57,8 @@ SPEC CHECKSUMS: iOSDropDown: ce9daa584eaa5567cafc1b633e3cc7eb6d9cea42 iOSSnapshotTestCase: a670511f9ee3829c2b9c23e6e68f315fd7b6790f Kingfisher: 6c5449c6450c5239166510ba04afe374a98afc4f - Kommunicate: 85ae069d27888d47fe44927d8acf0bedc5908f63 - KommunicateChatUI-iOS-SDK: 9d0b4fa2a6b22786dce8bd00d7198f58d2c9d9ac + Kommunicate: f9cc734f6934d2554908e1e9ba0888aaca079c33 + KommunicateChatUI-iOS-SDK: bea6efa038de0df45a3c40f84c93e0bf788a9167 KommunicateCore-iOS-SDK: 83e2c8d5b3007417354752a457068bd07e6d2e03 Nimble: f8a8219d16f176429b951e8f7e72df5c23ceddc0 Nimble-Snapshots: 4988d1cf2fe062f13bd2eb87c4279770785e682b diff --git a/Kommunicate.podspec b/Kommunicate.podspec index 66c30051..656cf46a 100644 --- a/Kommunicate.podspec +++ b/Kommunicate.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'Kommunicate' - s.version = '7.0.8' + s.version = '7.0.9' s.summary = 'Kommunicate iOS SDK for customer support.' s.homepage = 'https://github.com/Kommunicate-io/Kommunicate-iOS-SDK' s.license = { :type => 'BSD-3-Clause', :file => 'LICENSE' } @@ -10,5 +10,5 @@ Pod::Spec.new do |s| s.swift_version = '5.0' s.source_files = 'Sources/Kommunicate/Classes/**/*.{swift}' s.resources = 'Sources/Resources/**/*{lproj,storyboard,xib,xcassets,json,strings}' - s.dependency 'KommunicateChatUI-iOS-SDK' , '~> 1.2.3' + s.dependency 'KommunicateChatUI-iOS-SDK' , '~> 1.2.4' end diff --git a/Package.resolved b/Package.resolved index c45d2e17..3eddc763 100644 --- a/Package.resolved +++ b/Package.resolved @@ -33,8 +33,8 @@ "repositoryURL": "https://github.com/Kommunicate-io/KommunicateChatUI-iOS-SDK.git", "state": { "branch": null, - "revision": "cc6df4a9a9149549aa63bcf06637797eb5acac21", - "version": "1.2.3" + "revision": "70adbe88587c17b5b92193e67afb057bf7ff9fc4", + "version": "1.2.4" } }, { diff --git a/Package.swift b/Package.swift index 66f74e9e..ac52316d 100644 --- a/Package.swift +++ b/Package.swift @@ -13,7 +13,7 @@ let package = Package( ), ], dependencies: [ - .package(name: "KommunicateChatUI-iOS-SDK", url: "https://github.com/Kommunicate-io/KommunicateChatUI-iOS-SDK.git", from: "1.2.3"), + .package(name: "KommunicateChatUI-iOS-SDK", url: "https://github.com/Kommunicate-io/KommunicateChatUI-iOS-SDK.git", from: "1.2.4"), ], targets: [ .target( diff --git a/Sources/Kommunicate/Classes/FaqViewController.swift b/Sources/Kommunicate/Classes/FaqViewController.swift index 3d92102e..53fe6099 100644 --- a/Sources/Kommunicate/Classes/FaqViewController.swift +++ b/Sources/Kommunicate/Classes/FaqViewController.swift @@ -30,11 +30,15 @@ public class FaqViewController: UIViewController, Localizable { let webConfiguration = WKWebViewConfiguration() webView = WKWebView(frame: .zero, configuration: webConfiguration) webView.allowsBackForwardNavigationGestures = true + webView.scrollView.backgroundColor = UIColor.kmDynamicColor(light: .white, dark: .backgroundDarkColor()) + webView.backgroundColor = UIColor.kmDynamicColor(light: .white, dark: .backgroundDarkColor()) webView.navigationDelegate = self webView.configuration.userContentController.addUserScript(self.getZoomDisableScript()) + if UIColor.isKMDarkModeEnabled { + injectDynamicStyles() + } view = webView } - private func getZoomDisableScript() -> WKUserScript { let source: String = "var meta = document.createElement('meta');" + @@ -44,6 +48,30 @@ public class FaqViewController: UIViewController, Localizable { return WKUserScript(source: source, injectionTime: .atDocumentEnd, forMainFrameOnly: true) } + private func injectDynamicStyles() { + let dynamicStylesScript = """ + function prefersDarkMode() { + return window.matchMedia('(prefers-color-scheme: dark)').matches; + } + + function applyDynamicStyles() { + var initialBackgroundColor = prefersDarkMode() ? '#1C1C1C' : '#ffffff'; + document.body.style.backgroundColor = initialBackgroundColor; + + if (prefersDarkMode()) { + document.body.style.backgroundColor = '#1C1C1C'; + } else { + document.body.style.backgroundColor = '#ffffff'; + } + } + + applyDynamicStyles(); + """ + let dynamicStylesScriptInjection = WKUserScript(source: dynamicStylesScript, injectionTime: .atDocumentEnd, forMainFrameOnly: true) + + webView.configuration.userContentController.addUserScript(dynamicStylesScriptInjection) + } + override public func viewDidLoad() { super.viewDidLoad() webView.load(URLRequest(url: url)) diff --git a/Sources/Kommunicate/Classes/Views/ConversationClosedView.swift b/Sources/Kommunicate/Classes/Views/ConversationClosedView.swift index e11d0c02..4b71f1a6 100644 --- a/Sources/Kommunicate/Classes/Views/ConversationClosedView.swift +++ b/Sources/Kommunicate/Classes/Views/ConversationClosedView.swift @@ -16,7 +16,7 @@ class ConversationClosedView: UIView { private let conversationResolvedLabel: UILabel = { let label = UILabel(frame: .zero) label.numberOfLines = 1 - label.textColor = .text(.brownishGreyTwo) + label.textColor = UIColor.kmDynamicColor(light: .text(.brownishGreyTwo), dark: UIColor.text(.warmGrey)) label.font = Style.Font.normal(size: 15).font() label.backgroundColor = .clear label.text = LocalizedText.conversationResolved @@ -99,7 +99,7 @@ class ConversationClosedView: UIView { action: #selector(restartConversationTapped), for: .touchUpInside ) - backgroundColor = .background(.mediumGrey) + backgroundColor = UIColor.kmDynamicColor(light: UIColor.background(.mediumGrey), dark: UIColor.appBarDarkColor()) setupLayout() }