Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions examples/consentmanager/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentpass/examples-consentmanager",
"version": "0.0.1",
"version": "0.0.2",
"main": "index.ts",
"scripts": {
"start": "expo start",
Expand All @@ -12,25 +12,25 @@
"@contentpass/react-native-contentpass-cmp-consentmanager": "workspace:*",
"@contentpass/react-native-contentpass-ui": "workspace:*",
"cm-sdk-react-native-v3": "^3.10.0",
"expo": "~54.0.33",
"expo-status-bar": "~3.0.9",
"react": "19.1.0",
"react-native": "0.81.5",
"react-native-app-auth": "^8.1.0",
"expo": "~55.0.26",
"expo-status-bar": "~55.0.6",
"react": "19.2.0",
"react-native": "0.83.6",
"react-native-app-auth": "^8.4.0",
"react-native-encrypted-storage": "^4.0.3",
"react-native-webview": "^13.15.0"
},
"devDependencies": {
"@babel/core": "^7.29.0",
"@babel/preset-env": "^7.29.0",
"@babel/runtime": "^7.28.6",
"@react-native-community/cli": "19.1.2",
"@react-native-community/cli-platform-android": "19.1.2",
"@react-native-community/cli-platform-ios": "19.1.2",
"@react-native/babel-preset": "0.81.5",
"@react-native/metro-config": "0.81.5",
"@react-native/typescript-config": "0.81.5",
"babel-preset-expo": "^54.0.10",
"@react-native-community/cli": "20.1.3",
"@react-native-community/cli-platform-android": "20.1.3",
"@react-native-community/cli-platform-ios": "20.1.3",
"@react-native/babel-preset": "0.83.6",
"@react-native/metro-config": "0.83.6",
"@react-native/typescript-config": "0.83.6",
"babel-preset-expo": "^55.0.22",
"react-native-builder-bob": "^0.40.17"
},
"private": true
Expand Down
26 changes: 13 additions & 13 deletions examples/onetrust/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,26 @@
"@contentpass/react-native-contentpass": "workspace:*",
"@contentpass/react-native-contentpass-cmp-onetrust": "workspace:*",
"@contentpass/react-native-contentpass-ui": "workspace:*",
"expo": "~54.0.33",
"expo-status-bar": "~3.0.9",
"react": "19.1.0",
"react-native": "0.81.5",
"react-native-app-auth": "^8.1.0",
"expo": "~55.0.26",
"expo-status-bar": "~55.0.6",
"react": "19.2.0",
"react-native": "0.83.6",
"react-native-app-auth": "^8.4.0",
"react-native-encrypted-storage": "^4.0.3",
"react-native-onetrust-cmp": "202601.1.0",
"react-native-onetrust-cmp": "202602.1.2",
"react-native-webview": "^13.15.0"
},
"devDependencies": {
"@babel/core": "^7.29.0",
"@babel/preset-env": "^7.29.0",
"@babel/runtime": "^7.28.6",
"@react-native-community/cli": "19.1.2",
"@react-native-community/cli-platform-android": "19.1.2",
"@react-native-community/cli-platform-ios": "19.1.2",
"@react-native/babel-preset": "0.81.5",
"@react-native/metro-config": "0.81.5",
"@react-native/typescript-config": "0.81.5",
"babel-preset-expo": "^54.0.10",
"@react-native-community/cli": "20.1.3",
"@react-native-community/cli-platform-android": "20.1.3",
"@react-native-community/cli-platform-ios": "20.1.3",
"@react-native/babel-preset": "0.83.6",
"@react-native/metro-config": "0.83.6",
"@react-native/typescript-config": "0.83.6",
"babel-preset-expo": "^55.0.22",
"patch-package": "^8.0.1",
"postinstall-postinstall": "^2.1.0",
"react-native-builder-bob": "^0.40.17"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/node_modules/react-native-onetrust-cmp/android/src/main/java/com/onetrust/OneTrust.java b/node_modules/react-native-onetrust-cmp/android/src/main/java/com/onetrust/OneTrust.java
index 199531c..c3cfd17 100644
index 23e6beb..8c85220 100644
--- a/node_modules/react-native-onetrust-cmp/android/src/main/java/com/onetrust/OneTrust.java
+++ b/node_modules/react-native-onetrust-cmp/android/src/main/java/com/onetrust/OneTrust.java
@@ -313,6 +313,39 @@ public class OneTrust extends ReactContextBaseJavaModule {
Expand Down Expand Up @@ -43,7 +43,7 @@ index 199531c..c3cfd17 100644
public void showConsentPurposesUI(){
final Activity currentActivity = getCurrentActivity();
diff --git a/node_modules/react-native-onetrust-cmp/iOS/OneTrust.m b/node_modules/react-native-onetrust-cmp/iOS/OneTrust.m
index 2c1a676..c20f76a 100644
index 2c1a676..c84294f 100644
--- a/node_modules/react-native-onetrust-cmp/iOS/OneTrust.m
+++ b/node_modules/react-native-onetrust-cmp/iOS/OneTrust.m
@@ -36,6 +36,21 @@ + (BOOL)requiresMainQueueSetup{
Expand All @@ -68,14 +68,53 @@ index 2c1a676..c20f76a 100644
RCT_EXTERN_METHOD(shouldShowBanner:
(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject
@@ -65,6 +80,11 @@ + (BOOL)requiresMainQueueSetup{
rejecter:(RCTPromiseRejectBlock)reject
)

+RCT_EXTERN_METHOD(logATTConsent:
+ (RCTPromiseResolveBlock)resolve
+ rejecter:(RCTPromiseRejectBlock)reject
+ )
+
//Universal Consent Methods
RCT_EXTERN_METHOD(showConsentPurposesUI)

diff --git a/node_modules/react-native-onetrust-cmp/iOS/OneTrust.swift b/node_modules/react-native-onetrust-cmp/iOS/OneTrust.swift
index 0030d64..c9c97f0 100644
index 0030d64..894862f 100644
--- a/node_modules/react-native-onetrust-cmp/iOS/OneTrust.swift
+++ b/node_modules/react-native-onetrust-cmp/iOS/OneTrust.swift
@@ -108,6 +108,62 @@ import AppTrackingTransparency

}

@@ -81,31 +81,64 @@ import AppTrackingTransparency

@objc(getOTGoogleConsentModeData:rejecter:)
public func getOTGoogleConsentModeData(_ resolve:@escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock){
- let gcmOTData = OTPublishersHeadlessSDK.shared.getOTGoogleConsentModeData()
- let analyticsStorageValue = gcmOTData.consentType.analyticsStorage == .granted ? "granted" : "denied"
- let addStorageValue = gcmOTData.consentType.adStorage == .granted ? "granted" : "denied"
- let adUserDataValue = gcmOTData.consentType.adUserData == .granted ? "granted" : "denied"
- let adPersonalizationValue = gcmOTData.consentType.adPersonalization == .granted ? "granted" : "denied"
- let functionalityStorageValue = gcmOTData.consentType.functionalityStorage == .granted ? "granted" : "denied"
- let personalizationStorageValue = gcmOTData.consentType.personalizationStorage == .granted ? "granted" : "denied"
- let securityStorageValue = gcmOTData.consentType.securityStorage == .granted ? "granted" : "denied"
-
- let gcmOTDataJSONObject: [String: String] = [
- "analytics_storage": analyticsStorageValue,
- "ad_storage": addStorageValue,
- "ad_user_data": adUserDataValue,
- "ad_personalization": adPersonalizationValue,
- "functionality_storage": functionalityStorageValue,
- "personalization_storage": personalizationStorageValue,
- "security_storage": securityStorageValue
- ]
- let encoder = JSONEncoder()
- if let jsonData = try? encoder.encode(gcmOTDataJSONObject) {
- if let jsonString = String(data: jsonData, encoding: .utf8) {
- resolve(jsonString)
- }
+ // OTGoogleConsentMode not used in this app - stubbed to avoid linker errors
+ resolve(nil)
+ }
+
+ private func serializeToJSON(_ data: [String: Any]) -> String? {
+ guard JSONSerialization.isValidJSONObject(data),
+ let jsonData = try? JSONSerialization.data(withJSONObject: data),
Expand All @@ -99,7 +138,7 @@ index 0030d64..c9c97f0 100644
+ resolve(json)
+ } else {
+ reject("OT_GET_PREFERENCE_CENTER_DATA","OneTrust getPreferenceCenterData returned unsupported type.",nil)
+ }
}
+ return
+ }
+ OTPublishersHeadlessSDK.shared.fetchPreferencesCmpApiData { [weak self] _ in
Expand All @@ -111,7 +150,7 @@ index 0030d64..c9c97f0 100644
+ resolve(json)
+ }
+ }
+
+ @objc(getBannerData:rejecter:)
+ public func getBannerData(_ resolve:@escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock){
+ if let data = OTPublishersHeadlessSDK.shared.getBannerData() {
Expand All @@ -130,11 +169,47 @@ index 0030d64..c9c97f0 100644
+ }
+ resolve(json)
+ }
+ }
+
}
@objc(shouldShowBanner:rejecter:)
public func shouldShowBanner(_ resolve:@escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock) -> Void{
let shouldShowBanner = OTPublishersHeadlessSDK.shared.shouldShowBanner()
@@ -153,6 +186,28 @@ import AppTrackingTransparency
public func getATTStatus(_ resolve:@escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock){
resolve(getATTStatusAsString())
}
+
+ /// Logs the current ATT status to OneTrust without showing any UI.
+ /// This allows the SDK to persist consent to the server for ATT-linked categories.
+ @objc(logATTConsent:rejecter:)
+ public func logATTConsent(_ resolve:@escaping RCTPromiseResolveBlock, rejecter reject: @escaping RCTPromiseRejectBlock){
+ guard #available(iOS 14, *) else {
+ resolve(nil)
+ return
+ }
+ let interactionType: ConsentInteractionType
+ switch ATTrackingManager.trackingAuthorizationStatus {
+ case .authorized:
+ interactionType = .appTrackingConfirm
+ case .denied, .restricted:
+ interactionType = .appTrackingOptOut
+ default:
+ interactionType = .appTrackingNotGiven
+ }
+ OTPublishersHeadlessSDK.shared.saveConsent(type: interactionType) {
+ resolve(nil)
+ }
+ }
#endif

@objc(showConsentUI:resolve:rejecter:)
@@ -177,6 +232,8 @@ import AppTrackingTransparency
OTPublishersHeadlessSDK.shared.showConsentUI(for: type, from: vc, completion: {
resolve(nil)
})
+ } else {
+ resolve(nil)
}
}
}
diff --git a/node_modules/react-native-onetrust-cmp/index.ts b/node_modules/react-native-onetrust-cmp/index.ts
index f99e8c5..33c48c8 100644
--- a/node_modules/react-native-onetrust-cmp/index.ts
Expand Down
24 changes: 12 additions & 12 deletions examples/sourcepoint-expo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,24 @@
"dependencies": {
"@contentpass/examples-sourcepoint-shared": "workspace:*",
"@sourcepoint/react-native-cmp": "^1.0.13",
"expo": "~54.0.33",
"expo-status-bar": "~3.0.9",
"react": "19.1.0",
"react-native": "0.81.5",
"react-native-app-auth": "^8.1.0",
"expo": "~55.0.26",
"expo-status-bar": "~55.0.6",
"react": "19.2.0",
"react-native": "0.83.6",
"react-native-app-auth": "^8.4.0",
"react-native-encrypted-storage": "^4.0.3"
},
"devDependencies": {
"@babel/core": "^7.29.0",
"@babel/preset-env": "^7.29.0",
"@babel/runtime": "^7.28.6",
"@react-native-community/cli": "19.1.2",
"@react-native-community/cli-platform-android": "19.1.2",
"@react-native-community/cli-platform-ios": "19.1.2",
"@react-native/babel-preset": "0.81.5",
"@react-native/metro-config": "0.81.5",
"@react-native/typescript-config": "0.81.5",
"babel-preset-expo": "^54.0.10",
"@react-native-community/cli": "20.1.3",
"@react-native-community/cli-platform-android": "20.1.3",
"@react-native-community/cli-platform-ios": "20.1.3",
"@react-native/babel-preset": "0.83.6",
"@react-native/metro-config": "0.83.6",
"@react-native/typescript-config": "0.83.6",
"babel-preset-expo": "^55.0.22",
"patch-package": "^8.0.1",
"postinstall-postinstall": "^2.1.0",
"react-native-builder-bob": "^0.40.17"
Expand Down
18 changes: 9 additions & 9 deletions examples/sourcepoint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@
"@contentpass/react-native-contentpass": "workspace:*",
"@contentpass/react-native-contentpass-ui": "workspace:*",
"@sourcepoint/react-native-cmp": "^1.0.13",
"react": "19.1.0",
"react-native": "0.81.5",
"react-native-app-auth": "^8.1.0",
"react": "19.2.0",
"react-native": "0.83.6",
"react-native-app-auth": "^8.4.0",
"react-native-encrypted-storage": "^4.0.3"
},
"devDependencies": {
"@babel/core": "^7.29.0",
"@babel/preset-env": "^7.29.0",
"@react-native-community/cli": "^19.1.2",
"@react-native-community/cli-platform-android": "^19.1.2",
"@react-native-community/cli-platform-ios": "^19.1.2",
"@react-native/babel-preset": "0.81.5",
"@react-native/metro-config": "0.81.5",
"@react-native/typescript-config": "0.81.5",
"@react-native-community/cli": "^20.1.3",
"@react-native-community/cli-platform-android": "^20.1.3",
"@react-native-community/cli-platform-ios": "^20.1.3",
"@react-native/babel-preset": "0.83.6",
"@react-native/metro-config": "0.83.6",
"@react-native/typescript-config": "0.83.6",
"patch-package": "^8.0.1",
"postinstall-postinstall": "^2.1.0",
"react-native-builder-bob": "^0.40.17"
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
"@commitlint/config-conventional": "^20.4.1",
"@eslint/eslintrc": "^3.3.0",
"@evilmartians/lefthook": "^2.1.0",
"@react-native-community/cli": "19.1.2",
"@react-native/babel-preset": "0.81.5",
"@react-native/eslint-config": "^0.81.5",
"@react-native-community/cli": "20.1.3",
"@react-native/babel-preset": "0.83.6",
"@react-native/eslint-config": "^0.83.6",
"@testing-library/react-native": "^13.3.3",
"@types/jest": "^30.0.0",
"@types/lodash": "^4.17.23",
Expand All @@ -58,19 +58,19 @@
"eslint-plugin-prettier": "^5.5.5",
"jest": "^30.2.0",
"prettier": "^3.8.1",
"react": "19.1.0",
"react-native": "0.81.5",
"react-native-app-auth": "^8.1.0",
"react": "19.2.0",
"react-native": "0.83.6",
"react-native-app-auth": "^8.4.0",
"react-native-builder-bob": "^0.40.17",
"react-native-encrypted-storage": "^4.0.3",
"react-test-renderer": "19.1.0",
"react-test-renderer": "19.2.0",
"turbo": "^2.8.2",
"typescript": "^5.9.3"
},
"resolutions": {
"@types/react": "^18.2.44",
"react": "19.1.0",
"react-native": "0.81.5"
"@types/react": "^19.2.10",
"react": "19.2.0",
"react-native": "0.83.6"
},
"workspaces": [
"packages/*",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @contentpass/react-native-contentpass-cmp-consentmanager

## 0.1.0

### Minor Changes

- Bump versions

## 0.0.1

### Patch Changes
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentpass/react-native-contentpass-cmp-consentmanager",
"version": "0.0.1",
"version": "0.1.0",
"description": "Contentpass Consentmanager CMP adapter",
"source": "./src/index.ts",
"main": "./lib/commonjs/index.js",
Expand Down Expand Up @@ -58,13 +58,13 @@
},
"devDependencies": {
"@contentpass/react-native-contentpass": "workspace:*",
"@react-native-community/cli": "20.1.1",
"@react-native/babel-preset": "0.83.1",
"@react-native-community/cli": "20.1.3",
"@react-native/babel-preset": "0.83.6",
"@types/jest": "^30.0.0",
"@types/react": "^19.2.10",
"jest": "^30.2.0",
"react": "19.2.4",
"react-native": "0.83.1",
"react": "19.2.0",
"react-native": "0.83.6",
"react-native-builder-bob": "^0.40.17",
"typescript": "^5.9.3"
},
Expand Down
6 changes: 6 additions & 0 deletions packages/react-native-contentpass-cmp-onetrust/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @contentpass/react-native-contentpass-cmp-onetrust

## 0.3.0

### Minor Changes

- Bump versions

## 0.2.1

### Patch Changes
Expand Down
Loading
Loading