diff --git a/ReactNativeCmp.podspec b/ReactNativeCmp.podspec
index 1c2e0ac..b034e6c 100644
--- a/ReactNativeCmp.podspec
+++ b/ReactNativeCmp.podspec
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
s.platforms = { :ios => min_ios_version_supported }
s.source = { :git => "https://github.com/SourcePointUSA/react-native-sourcepoint-cmp.git", :tag => "#{s.version}" }
- s.dependency "ConsentViewController", "7.10.0"
+ s.dependency "ConsentViewController", "7.11.0"
s.source_files = "ios/**/*.{h,m,mm,cpp,swift}"
s.private_header_files = "ios/**/*.h"
diff --git a/android/build.gradle b/android/build.gradle
index ba3a85c..3808e19 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -77,7 +77,7 @@ dependencies {
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:1.7.3"
implementation "org.jetbrains.kotlinx:kotlinx-datetime:0.6.1"
- implementation "com.sourcepoint.cmplibrary:cmplibrary:7.15.0"
+ implementation "com.sourcepoint.cmplibrary:cmplibrary:7.15.1"
}
react {
diff --git a/android/src/main/java/com/sourcepoint/reactnativecmp/ReactNativeCmpModule.kt b/android/src/main/java/com/sourcepoint/reactnativecmp/ReactNativeCmpModule.kt
index aaec033..011ea4e 100644
--- a/android/src/main/java/com/sourcepoint/reactnativecmp/ReactNativeCmpModule.kt
+++ b/android/src/main/java/com/sourcepoint/reactnativecmp/ReactNativeCmpModule.kt
@@ -110,6 +110,10 @@ class ReactNativeCmpModule(reactContext: ReactApplicationContext) : NativeReactN
runOnMainThread { spConsentLib?.loadPrivacyManager(pmId, GLOBALCMP) }
}
+ override fun loadPreferenceCenter(id: String) {
+ runOnMainThread { spConsentLib?.loadPrivacyManager(id, PREFERENCES) }
+ }
+
companion object {
const val NAME = "ReactNativeCmp"
}
diff --git a/example/ios/Podfile.lock b/example/ios/Podfile.lock
index 22fa3b7..211c9b4 100644
--- a/example/ios/Podfile.lock
+++ b/example/ios/Podfile.lock
@@ -1,8 +1,8 @@
PODS:
- boost (1.84.0)
- - ConsentViewController (7.10.0):
+ - ConsentViewController (7.11.0):
- Down (~> 0.11.0)
- - SPMobileCore (= 0.1.9)
+ - SPMobileCore (= 0.1.10)
- DoubleConversion (1.1.6)
- fast_float (6.1.4)
- FBLazyVector (0.79.2)
@@ -1660,7 +1660,7 @@ PODS:
- React-perflogger (= 0.79.2)
- React-utils (= 0.79.2)
- ReactNativeCmp (1.0.2):
- - ConsentViewController (= 7.10.0)
+ - ConsentViewController (= 7.11.0)
- DoubleConversion
- glog
- hermes-engine
@@ -1685,7 +1685,7 @@ PODS:
- ReactCommon/turbomodule/core
- Yoga
- SocketRocket (0.7.1)
- - SPMobileCore (0.1.9)
+ - SPMobileCore (0.1.10)
- Yoga (0.0.0)
DEPENDENCIES:
@@ -1919,7 +1919,7 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS:
boost: 7e761d76ca2ce687f7cc98e698152abd03a18f90
- ConsentViewController: 079fad8b149491cfb52ec8bd7cf47c67eabb2b47
+ ConsentViewController: 1548d9e77c75b5be5136200be406f0f3b9ae173c
DoubleConversion: cb417026b2400c8f53ae97020b2be961b59470cb
fast_float: 06eeec4fe712a76acc9376682e4808b05ce978b6
FBLazyVector: 84b955f7b4da8b895faf5946f73748267347c975
@@ -1989,9 +1989,9 @@ SPEC CHECKSUMS:
ReactAppDependencyProvider: 04d5eb15eb46be6720e17a4a7fa92940a776e584
ReactCodegen: c63eda03ba1d94353fb97b031fc84f75a0d125ba
ReactCommon: 76d2dc87136d0a667678668b86f0fca0c16fdeb0
- ReactNativeCmp: fdc85cdc42332372a5cdac25012b9102d27e4765
+ ReactNativeCmp: 1ff6c3f35f9a8cd411a67c870425d8f29b6ad44d
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
- SPMobileCore: c3bfa7dacf26f6101900afa096a9b945a89f726a
+ SPMobileCore: 50aecf97a8fa8134bb84aaed4349a3a20a7e22b2
Yoga: c758bfb934100bb4bf9cbaccb52557cee35e8bdf
PODFILE CHECKSUM: decdc7519d77aa5eae65b167fa59bcfce25e15d2
diff --git a/example/src/App.tsx b/example/src/App.tsx
index 8c07744..2602b2b 100644
--- a/example/src/App.tsx
+++ b/example/src/App.tsx
@@ -34,6 +34,7 @@ const config = {
gdprPMId: '488393',
usnatPMId: '988851',
globalCmpPMId: '1323762',
+ preferencesCenterId: '1306779',
campaigns: {
gdpr: {},
usnat: { supportLegacyUSPString: true },
@@ -115,6 +116,11 @@ export default function App() {
consentManager.current?.loadGlobalCmpPrivacyManager(config.globalCmpPMId);
}, []);
+ const onPreferencesPress = useCallback(() => {
+ setSDKStatus(SDKStatus.Networking);
+ consentManager.current?.loadPreferenceCenter(config.preferencesCenterId);
+ }, []);
+
const onClearDataPress = useCallback(() => {
consentManager.current?.clearLocalData();
consentManager.current?.build(
@@ -165,6 +171,11 @@ export default function App() {
onPress={onGlobalCMPPress}
disabled={disable || config.campaigns.globalcmp == undefined}
/>
+
{sdkStatus}
diff --git a/ios/RNSourcepointCmp.swift b/ios/RNSourcepointCmp.swift
index 4e7e384..40d22a4 100644
--- a/ios/RNSourcepointCmp.swift
+++ b/ios/RNSourcepointCmp.swift
@@ -72,6 +72,10 @@ import React
consentManager?.loadGlobalCmpPrivacyManager(withId: pmId)
}
+ public func loadPreferenceCenter(_ id: String) {
+ consentManager?.loadPreferenceCenter(withId: id)
+ }
+
weak var rootViewController: UIViewController? {
UIApplication.shared.delegate?.window??.rootViewController
}
diff --git a/ios/ReactNativeCmp.mm b/ios/ReactNativeCmp.mm
index e93d503..188d3e5 100644
--- a/ios/ReactNativeCmp.mm
+++ b/ios/ReactNativeCmp.mm
@@ -94,6 +94,9 @@ - (void)loadGlobalCmpPrivacyManager:(nonnull NSString *)pmId {
[sdk loadGlobalCMPPrivacyManager: pmId];
}
+- (void)loadPreferenceCenter:(nonnull NSString *)id {
+ [sdk loadPreferenceCenter: id];
+}
// MARK: SPDelegate
- (void)onAction:(RNAction*)action {
diff --git a/src/NativeReactNativeCmp.ts b/src/NativeReactNativeCmp.ts
index c8f7495..7c32690 100644
--- a/src/NativeReactNativeCmp.ts
+++ b/src/NativeReactNativeCmp.ts
@@ -153,6 +153,7 @@ export interface Spec extends TurboModule {
loadGDPRPrivacyManager(pmId: string): void;
loadUSNatPrivacyManager(pmId: string): void;
loadGlobalCmpPrivacyManager(pmId: string): void;
+ loadPreferenceCenter(id: string): void;
readonly onAction: EventEmitter;
readonly onSPUIReady: EventEmitter;
diff --git a/src/index.tsx b/src/index.tsx
index b5a3768..06d2694 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -44,6 +44,10 @@ export default class SPConsentManager implements Spec {
ReactNativeCmp.loadGlobalCmpPrivacyManager(pmId);
}
+ loadPreferenceCenter(id: string) {
+ ReactNativeCmp.loadPreferenceCenter(id);
+ }
+
onAction: EventEmitter = ReactNativeCmp.onAction;
onSPUIReady: EventEmitter = ReactNativeCmp.onSPUIReady;
onSPUIFinished: EventEmitter = ReactNativeCmp.onSPUIFinished;