|
| 1 | +diff --git a/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpModule.kt b/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpModule.kt |
| 2 | +index deb04fb18dbd8adffcb225801ad35b3154a3c7ad..4d372d921cbae6163179435feb9c821e3c37134b 100644 |
| 3 | +--- a/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpModule.kt |
| 4 | ++++ b/android/src/main/java/com/sourcepoint/reactnativecmp/RNSourcepointCmpModule.kt |
| 5 | +@@ -119,6 +119,7 @@ class RNSourcepointCmpModule internal constructor(context: ReactApplicationConte |
| 6 | + override fun onAction(view: View, consentAction: ConsentAction): ConsentAction { |
| 7 | + sendEvent(SDKEvent.onAction, createMap().apply { |
| 8 | + putString("actionType", RNSourcepointActionType.from(consentAction.actionType).name) |
| 9 | ++ putString("customActionId", consentAction.customActionId ?: "") |
| 10 | + }) |
| 11 | + return consentAction |
| 12 | + } |
| 13 | +diff --git a/ios/RNSourcepointCmp.swift b/ios/RNSourcepointCmp.swift |
| 14 | +index 556b56618c847ad8aeaf9cdc680813cc26b732a9..ba7d707232d72fe5038ec05fb6fdb8e27216e4ee 100644 |
| 15 | +--- a/ios/RNSourcepointCmp.swift |
| 16 | ++++ b/ios/RNSourcepointCmp.swift |
| 17 | +@@ -69,7 +69,10 @@ extension RNSourcepointCmp: SPDelegate { |
| 18 | + func onAction(_ action: SPAction, from controller: UIViewController) { |
| 19 | + RNSourcepointCmp.shared?.sendEvent( |
| 20 | + withName: "onAction", |
| 21 | +- body: ["actionType": RNSourcepointActionType(from: action.type).rawValue] |
| 22 | ++ body: [ |
| 23 | ++ "actionType": RNSourcepointActionType(from: action.type).rawValue, |
| 24 | ++ "customActionId": action.customActionId ?? "", |
| 25 | ++ ] |
| 26 | + ) |
| 27 | + } |
| 28 | + |
| 29 | +diff --git a/lib/typescript/src/index.d.ts b/lib/typescript/src/index.d.ts |
| 30 | +index 1602516717becd5ec0a8e5036ad2d821110af96f..67bb9e5153b7489c5ead4dcd056b502b71bc2a7d 100644 |
| 31 | +--- a/lib/typescript/src/index.d.ts |
| 32 | ++++ b/lib/typescript/src/index.d.ts |
| 33 | +@@ -12,6 +12,7 @@ export declare class SPConsentManager implements Spec { |
| 34 | + loadUSNatPrivacyManager(pmId: string): void; |
| 35 | + onAction(callback: (body: { |
| 36 | + actionType: SPActionType; |
| 37 | ++ customActionId: string; |
| 38 | + }) => void): void; |
| 39 | + onSPUIReady(callback: () => void): void; |
| 40 | + onSPUIFinished(callback: () => void): void; |
| 41 | +diff --git a/lib/typescript/src/types.d.ts b/lib/typescript/src/types.d.ts |
| 42 | +index a15f7a06c3e0635168987a44a33009ff42bbd31c..a035a72af14f32adf0ff88f959eb8c517ffaea47 100644 |
| 43 | +--- a/lib/typescript/src/types.d.ts |
| 44 | ++++ b/lib/typescript/src/types.d.ts |
| 45 | +@@ -86,6 +86,7 @@ export interface Spec extends TurboModule { |
| 46 | + loadUSNatPrivacyManager(pmId: string): void; |
| 47 | + onAction(callback: (body: { |
| 48 | + actionType: SPActionType; |
| 49 | ++ customActionId: string; |
| 50 | + }) => void): void; |
| 51 | + onSPUIReady(callback: () => void): void; |
| 52 | + onSPUIFinished(callback: () => void): void; |
| 53 | +diff --git a/src/index.ts b/src/index.ts |
| 54 | +index b3e76b15572c56f1a4e54068b90243d6dd028e18..a03d87fea4a93edb6bf904c99d32b029b840bade 100644 |
| 55 | +--- a/src/index.ts |
| 56 | ++++ b/src/index.ts |
| 57 | +@@ -67,7 +67,7 @@ export class SPConsentManager implements Spec { |
| 58 | + RNSourcepointCmp.loadUSNatPrivacyManager(pmId); |
| 59 | + } |
| 60 | + |
| 61 | +- onAction(callback: (body: { actionType: SPActionType }) => void): void { |
| 62 | ++ onAction(callback: (body: { actionType: SPActionType, customActionId: string }) => void): void { |
| 63 | + this.emitter.removeAllListeners('onAction'); |
| 64 | + this.emitter.addListener('onAction', callback); |
| 65 | + } |
| 66 | +diff --git a/src/types.ts b/src/types.ts |
| 67 | +index 26ac3d8162c0534af98e2a20d237856195fe5a10..4257aff5ed128988c7d3fba60545672966162b20 100644 |
| 68 | +--- a/src/types.ts |
| 69 | ++++ b/src/types.ts |
| 70 | +@@ -113,7 +113,7 @@ export interface Spec extends TurboModule { |
| 71 | + loadGDPRPrivacyManager(pmId: string): void; |
| 72 | + loadUSNatPrivacyManager(pmId: string): void; |
| 73 | + |
| 74 | +- onAction(callback: (body: { actionType: SPActionType }) => void): void; |
| 75 | ++ onAction(callback: (body: { actionType: SPActionType, customActionId: string }) => void): void; |
| 76 | + onSPUIReady(callback: () => void): void; |
| 77 | + onSPUIFinished(callback: () => void): void; |
| 78 | + onFinished(callback: () => void): void; |
0 commit comments