From 34badf3bc458c1b1cc8e3dd889a8a732a47f74f9 Mon Sep 17 00:00:00 2001 From: slawek Date: Fri, 7 Feb 2025 08:18:59 +0100 Subject: [PATCH 1/2] chore: add java version used in project --- .sdkmanrc | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .sdkmanrc diff --git a/.sdkmanrc b/.sdkmanrc new file mode 100644 index 0000000..79d039e --- /dev/null +++ b/.sdkmanrc @@ -0,0 +1,3 @@ +# Enable auto-env through the sdkman_auto_env config +# Add key=value pairs of SDKs to use below +java=23.0.2-tem From 795eabbce78fbdbbf458d979949a163e3d381fdf Mon Sep 17 00:00:00 2001 From: slawek Date: Fri, 7 Feb 2025 08:20:00 +0100 Subject: [PATCH 2/2] chore: upgrade sourcepoint sdk in demos --- ...eact-native-cmp-npm-0.3.0-2434c31dc9.patch | 78 ------------------- ...nt-react-native-cmp-patch-34fca36663.patch | 13 ---- example/package.json | 2 +- expoExample/package.json | 2 +- package.json | 3 +- sharedExample/package.json | 2 +- yarn.lock | 34 ++------ 7 files changed, 11 insertions(+), 123 deletions(-) delete mode 100644 .yarn/patches/@sourcepoint-react-native-cmp-npm-0.3.0-2434c31dc9.patch delete mode 100644 .yarn/patches/@sourcepoint-react-native-cmp-patch-34fca36663.patch diff --git a/.yarn/patches/@sourcepoint-react-native-cmp-npm-0.3.0-2434c31dc9.patch b/.yarn/patches/@sourcepoint-react-native-cmp-npm-0.3.0-2434c31dc9.patch deleted file mode 100644 index b916e3c..0000000 --- a/.yarn/patches/@sourcepoint-react-native-cmp-npm-0.3.0-2434c31dc9.patch +++ /dev/null @@ -1,78 +0,0 @@ -diff --git a/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpModule.kt b/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpModule.kt -index deb04fb18dbd8adffcb225801ad35b3154a3c7ad..4d372d921cbae6163179435feb9c821e3c37134b 100644 ---- a/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpModule.kt -+++ b/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpModule.kt -@@ -119,6 +119,7 @@ class RNSourcepointCmpModule internal constructor(context: ReactApplicationConte - override fun onAction(view: View, consentAction: ConsentAction): ConsentAction { - sendEvent(SDKEvent.onAction, createMap().apply { - putString("actionType", RNSourcepointActionType.from(consentAction.actionType).name) -+ putString("customActionId", consentAction.customActionId ?: "") - }) - return consentAction - } -diff --git a/ios/RNSourcepointCmp.swift b/ios/RNSourcepointCmp.swift -index 556b56618c847ad8aeaf9cdc680813cc26b732a9..ba7d707232d72fe5038ec05fb6fdb8e27216e4ee 100644 ---- a/ios/RNSourcepointCmp.swift -+++ b/ios/RNSourcepointCmp.swift -@@ -69,7 +69,10 @@ extension RNSourcepointCmp: SPDelegate { - func onAction(_ action: SPAction, from controller: UIViewController) { - RNSourcepointCmp.shared?.sendEvent( - withName: "onAction", -- body: ["actionType": RNSourcepointActionType(from: action.type).rawValue] -+ body: [ -+ "actionType": RNSourcepointActionType(from: action.type).rawValue, -+ "customActionId": action.customActionId ?? "", -+ ] - ) - } - -diff --git a/lib/typescript/src/index.d.ts b/lib/typescript/src/index.d.ts -index 1602516717becd5ec0a8e5036ad2d821110af96f..67bb9e5153b7489c5ead4dcd056b502b71bc2a7d 100644 ---- a/lib/typescript/src/index.d.ts -+++ b/lib/typescript/src/index.d.ts -@@ -12,6 +12,7 @@ export declare class SPConsentManager implements Spec { - loadUSNatPrivacyManager(pmId: string): void; - onAction(callback: (body: { - actionType: SPActionType; -+ customActionId: string; - }) => void): void; - onSPUIReady(callback: () => void): void; - onSPUIFinished(callback: () => void): void; -diff --git a/lib/typescript/src/types.d.ts b/lib/typescript/src/types.d.ts -index a15f7a06c3e0635168987a44a33009ff42bbd31c..a035a72af14f32adf0ff88f959eb8c517ffaea47 100644 ---- a/lib/typescript/src/types.d.ts -+++ b/lib/typescript/src/types.d.ts -@@ -86,6 +86,7 @@ export interface Spec extends TurboModule { - loadUSNatPrivacyManager(pmId: string): void; - onAction(callback: (body: { - actionType: SPActionType; -+ customActionId: string; - }) => void): void; - onSPUIReady(callback: () => void): void; - onSPUIFinished(callback: () => void): void; -diff --git a/src/index.ts b/src/index.ts -index b3e76b15572c56f1a4e54068b90243d6dd028e18..a03d87fea4a93edb6bf904c99d32b029b840bade 100644 ---- a/src/index.ts -+++ b/src/index.ts -@@ -67,7 +67,7 @@ export class SPConsentManager implements Spec { - RNSourcepointCmp.loadUSNatPrivacyManager(pmId); - } - -- onAction(callback: (body: { actionType: SPActionType }) => void): void { -+ onAction(callback: (body: { actionType: SPActionType, customActionId: string }) => void): void { - this.emitter.removeAllListeners('onAction'); - this.emitter.addListener('onAction', callback); - } -diff --git a/src/types.ts b/src/types.ts -index 26ac3d8162c0534af98e2a20d237856195fe5a10..4257aff5ed128988c7d3fba60545672966162b20 100644 ---- a/src/types.ts -+++ b/src/types.ts -@@ -113,7 +113,7 @@ export interface Spec extends TurboModule { - loadGDPRPrivacyManager(pmId: string): void; - loadUSNatPrivacyManager(pmId: string): void; - -- onAction(callback: (body: { actionType: SPActionType }) => void): void; -+ onAction(callback: (body: { actionType: SPActionType, customActionId: string }) => void): void; - onSPUIReady(callback: () => void): void; - onSPUIFinished(callback: () => void): void; - onFinished(callback: () => void): void; diff --git a/.yarn/patches/@sourcepoint-react-native-cmp-patch-34fca36663.patch b/.yarn/patches/@sourcepoint-react-native-cmp-patch-34fca36663.patch deleted file mode 100644 index 28b1936..0000000 --- a/.yarn/patches/@sourcepoint-react-native-cmp-patch-34fca36663.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpTypes.kt b/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpTypes.kt -index bb8c6c37adc3d7980c7e92268b98b9d97ef8de40..3d67b3a3f44743c4542a1966e66e1af3ea93c555 100644 ---- a/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpTypes.kt -+++ b/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpTypes.kt -@@ -16,7 +16,7 @@ data class SPCampaign( - val rawTargetingParam: ReadableMap?, - val supportLegacyUSPString: Boolean - ) { -- val targetingParams = rawTargetingParam?.toHashMap()?.map { TargetingParam(it.key, it.toString()) } ?: emptyList() -+ val targetingParams = rawTargetingParam?.toHashMap()?.map { TargetingParam(it.key, it.value.toString()) } ?: emptyList() - } - - data class SPCampaigns( diff --git a/example/package.json b/example/package.json index 54c7d46..d79437a 100644 --- a/example/package.json +++ b/example/package.json @@ -10,7 +10,7 @@ "build:ios": "react-native build-ios --scheme ContentpassExample --mode Debug --extra-params \"-sdk iphonesimulator CC=clang CPLUSPLUS=clang++ LD=clang LDPLUSPLUS=clang++ GCC_OPTIMIZATION_LEVEL=0 GCC_PRECOMPILE_PREFIX_HEADER=YES ASSETCATALOG_COMPILER_OPTIMIZATION=time DEBUG_INFORMATION_FORMAT=dwarf COMPILER_INDEX_STORE_ENABLE=NO\"" }, "dependencies": { - "@sourcepoint/react-native-cmp": "^0.3.0", + "@sourcepoint/react-native-cmp": "^0.4.0", "react": "18.3.1", "react-native": "0.76.2", "react-native-app-auth": "^8.0.0", diff --git a/expoExample/package.json b/expoExample/package.json index 1f7755e..a43a6a3 100644 --- a/expoExample/package.json +++ b/expoExample/package.json @@ -8,7 +8,7 @@ "ios": "expo run:ios" }, "dependencies": { - "@sourcepoint/react-native-cmp": "^0.3.0", + "@sourcepoint/react-native-cmp": "^0.4.0", "expo": "~52.0.11", "expo-status-bar": "~2.0.0", "react": "18.3.1", diff --git a/package.json b/package.json index 09c8194..7d7672b 100644 --- a/package.json +++ b/package.json @@ -99,8 +99,7 @@ "typescript": "^5.2.2" }, "resolutions": { - "@types/react": "^18.2.44", - "@sourcepoint/react-native-cmp@^0.3.0": "patch:@sourcepoint/react-native-cmp@patch%3A@sourcepoint/react-native-cmp@npm%253A0.3.0%23./.yarn/patches/@sourcepoint-react-native-cmp-npm-0.3.0-2434c31dc9.patch%3A%3Aversion=0.3.0&hash=664e70&locator=react-native-contentpass%2540workspace%253A.#./.yarn/patches/@sourcepoint-react-native-cmp-patch-34fca36663.patch" + "@types/react": "^18.2.44" }, "peerDependencies": { "react": "*", diff --git a/sharedExample/package.json b/sharedExample/package.json index 3f05214..9590adb 100644 --- a/sharedExample/package.json +++ b/sharedExample/package.json @@ -5,6 +5,6 @@ "@sourcepoint/react-native-cmp": "*" }, "devDependencies": { - "@sourcepoint/react-native-cmp": "^0.3.0" + "@sourcepoint/react-native-cmp": "^0.4.0" } } diff --git a/yarn.lock b/yarn.lock index f7dccc8..19404bf 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3853,33 +3853,13 @@ __metadata: languageName: node linkType: hard -"@sourcepoint/react-native-cmp@npm:0.3.0": - version: 0.3.0 - resolution: "@sourcepoint/react-native-cmp@npm:0.3.0" - peerDependencies: - react: "*" - react-native: "*" - checksum: dc41dc065a0ab54a87cfbd03fae4a78923904585eff2b9d6cedea35a1b662c5ee61ea0178af2121de3819afa995fbdf712503629a4e0189e822b9291e3dd42ba - languageName: node - linkType: hard - -"@sourcepoint/react-native-cmp@patch:@sourcepoint/react-native-cmp@npm%3A0.3.0#./.yarn/patches/@sourcepoint-react-native-cmp-npm-0.3.0-2434c31dc9.patch::version=0.3.0&hash=664e70&locator=react-native-contentpass%40workspace%3A.": - version: 0.3.0 - resolution: "@sourcepoint/react-native-cmp@patch:@sourcepoint/react-native-cmp@npm%3A0.3.0#./.yarn/patches/@sourcepoint-react-native-cmp-npm-0.3.0-2434c31dc9.patch::version=0.3.0&hash=664e70&locator=react-native-contentpass%40workspace%3A." - peerDependencies: - react: "*" - react-native: "*" - checksum: 19e09814040bb9d7e5aaf2bc9aa937f97fed96341ee21f676edcafda2d0300f24ec6799e81fe5c6c8583387e1fc542e72ad6e3756fa839ae2952dc102c9cad7e - languageName: node - linkType: hard - -"@sourcepoint/react-native-cmp@patch:@sourcepoint/react-native-cmp@patch%3A@sourcepoint/react-native-cmp@npm%253A0.3.0%23./.yarn/patches/@sourcepoint-react-native-cmp-npm-0.3.0-2434c31dc9.patch%3A%3Aversion=0.3.0&hash=664e70&locator=react-native-contentpass%2540workspace%253A.#./.yarn/patches/@sourcepoint-react-native-cmp-patch-34fca36663.patch::locator=%40contentpass%2Freact-native-contentpass%40workspace%3A.": - version: 0.3.0 - resolution: "@sourcepoint/react-native-cmp@patch:@sourcepoint/react-native-cmp@patch%3A@sourcepoint/react-native-cmp@npm%253A0.3.0%23./.yarn/patches/@sourcepoint-react-native-cmp-npm-0.3.0-2434c31dc9.patch%3A%3Aversion=0.3.0&hash=664e70&locator=react-native-contentpass%2540workspace%253A.#./.yarn/patches/@sourcepoint-react-native-cmp-patch-34fca36663.patch::version=0.3.0&hash=5a881d&locator=%40contentpass%2Freact-native-contentpass%40workspace%3A." +"@sourcepoint/react-native-cmp@npm:^0.4.0": + version: 0.4.0 + resolution: "@sourcepoint/react-native-cmp@npm:0.4.0" peerDependencies: react: "*" react-native: "*" - checksum: 0e4d72b3f43e6fa7ee00a7d9fddc53058a7b8dc0a513bc85d2d05f3cd58da2b52fecc498212d6546ae0cd40556c2ab4fa7e12ac8fa70a4e0716c6c2078aaf966 + checksum: 555d482f1d242aae97fddebddcb8a68aab8cef6f0f811f8f1b1e0f65c0a162cab2d51a39b417d2cc1a89bca73d3b8e84219d0a3f46d171a0f0e5f37da5491785 languageName: node linkType: hard @@ -12544,7 +12524,7 @@ __metadata: "@react-native/babel-preset": 0.76.2 "@react-native/metro-config": 0.76.2 "@react-native/typescript-config": 0.76.2 - "@sourcepoint/react-native-cmp": ^0.3.0 + "@sourcepoint/react-native-cmp": ^0.4.0 react: 18.3.1 react-native: 0.76.2 react-native-app-auth: ^8.0.0 @@ -12567,7 +12547,7 @@ __metadata: "@react-native/babel-preset": 0.76.2 "@react-native/metro-config": 0.76.2 "@react-native/typescript-config": 0.76.2 - "@sourcepoint/react-native-cmp": ^0.3.0 + "@sourcepoint/react-native-cmp": ^0.4.0 expo: ~52.0.11 expo-status-bar: ~2.0.0 react: 18.3.1 @@ -13558,7 +13538,7 @@ __metadata: version: 0.0.0-use.local resolution: "sharedExample@workspace:sharedExample" dependencies: - "@sourcepoint/react-native-cmp": ^0.3.0 + "@sourcepoint/react-native-cmp": ^0.4.0 peerDependencies: "@sourcepoint/react-native-cmp": "*" languageName: unknown