Skip to content

Commit 53f1c75

Browse files
Fixed scroll ability for custom webViews & script for solving issue with repeated CMP appearance in custom webView. Updated project version to 1.0.8.
1 parent c6fff5d commit 53f1c75

4 files changed

Lines changed: 23 additions & 19 deletions

File tree

ClickioConsentSDKManager.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Pod::Spec.new do |spec|
66

77
spec.module_name = "ClickioConsentSDKManager"
88

9-
spec.version = "1.0.7"
9+
spec.version = "1.0.8"
1010

1111
spec.summary = "Native SDK for managing user consents, integrating a WebView-based consent dialog into iOS apps for streamlined privacy compliance."
1212

ClickioConsentSDKManager.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,7 @@
468468
INFOPLIST_KEY_NSUserTrackingUsageDescription = "This app collects and tracks your usage data for the purpose of delivering personalized advertisements and measuring ad performance. By using this app, you acknowledge and agree that your information may be processed and shared with our advertising partners.";
469469
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
470470
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
471-
MARKETING_VERSION = 1.0.7;
471+
MARKETING_VERSION = 1.0.8;
472472
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
473473
MTL_FAST_MATH = YES;
474474
ONLY_ACTIVE_ARCH = YES;
@@ -530,7 +530,7 @@
530530
INFOPLIST_KEY_NSUserTrackingUsageDescription = "This app collects and tracks your usage data for the purpose of delivering personalized advertisements and measuring ad performance. By using this app, you acknowledge and agree that your information may be processed and shared with our advertising partners.";
531531
IPHONEOS_DEPLOYMENT_TARGET = 15.6;
532532
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
533-
MARKETING_VERSION = 1.0.7;
533+
MARKETING_VERSION = 1.0.8;
534534
MTL_ENABLE_DEBUG_INFO = NO;
535535
MTL_FAST_MATH = YES;
536536
SDKROOT = iphoneos;

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Before integrating `ClickioConsentSDKManager` (hereinafter reffered to as the `C
2020
**Swift Package Manager**
2121
- File > Swift Packages > Add Package Dependency
2222
- Add `https://github.com/ClickioTech/ClickioConsentSDK-IOS.git`
23-
- Select "Up to Next Major" with "1.0.7"
23+
- Select "Up to Next Major" with "1.0.8"
2424

2525
**CocoaPods**
2626
- You can install ClickioConsentSDKManager pod from CocoaPods library:
@@ -29,7 +29,7 @@ platform :ios, '15.0'
2929
use_frameworks!
3030
3131
target 'YourApp' do
32-
pod 'ClickioConsentSDKManager', '~> 1.0.7'
32+
pod 'ClickioConsentSDKManager', '~> 1.0.8'
3333
end
3434
```
3535

@@ -39,7 +39,7 @@ platform :ios, '15.0'
3939
use_frameworks!
4040
4141
target 'YourApp' do
42-
pod 'ClickioConsentSDKManager', :git => 'https://github.com/ClickioTech/ClickioConsentSDK-IOS.git', :tag => '1.0.7'
42+
pod 'ClickioConsentSDKManager', :git => 'https://github.com/ClickioTech/ClickioConsentSDK-IOS.git', :tag => '1.0.8'
4343
end
4444
```
4545

Sources/WebView/WebViewController/WebViewController.swift

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,24 @@ public final class WebViewController: UIViewController {
3030
let userContentController = WKUserContentController()
3131

3232
if customConfig != nil {
33-
let readBridge = """
34-
(function() {
35-
window.clickioSDK = window.clickioSDK || {};
36-
const originalRead = window.clickioSDK.read;
37-
38-
window.clickioSDK.read = function(key) {
39-
window.webkit.messageHandlers.clickioSDK.postMessage({ action: 'read', data: key });
40-
if (originalRead) originalRead.apply(this, arguments);
41-
};
42-
})();
43-
"""
33+
let readWriteBridge = """
34+
(function() {
35+
window.clickioSDK = window.clickioSDK || {};
36+
if (window.clickioSDK._patched) return;
37+
window.clickioSDK._patched = true;
38+
39+
window.clickioSDK.write = function(data) {
40+
return true;
41+
};
42+
43+
window.clickioSDK.read = function(key) {
44+
return true;
45+
};
46+
})();
47+
"""
4448
userContentController.addUserScript(
4549
WKUserScript(
46-
source: readBridge,
50+
source: readWriteBridge,
4751
injectionTime: .atDocumentStart,
4852
forMainFrameOnly: false
4953
)
@@ -88,7 +92,7 @@ public final class WebViewController: UIViewController {
8892
webView.uiDelegate = self
8993
webView.navigationDelegate = self
9094

91-
webView.scrollView.isScrollEnabled = false
95+
webView.scrollView.isScrollEnabled = true
9296
webView.scrollView.bounces = false
9397

9498
webView.translatesAutoresizingMaskIntoConstraints = false

0 commit comments

Comments
 (0)