cm-sdk-react-native-v3 3.5.3 → 3.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,38 +1,29 @@
1
- declare const CmSdkReactNativeV3: any;
2
- export declare const addConsentListener: (callback: (consent: string, jsonObject: any) => void) => import("react-native").EmitterSubscription;
1
+ import { type ConsentReceivedEvent, type ErrorEvent, type LinkClickEvent, type ATTStatusChangeEvent, type UrlConfig, type WebViewConfig, type UserStatus, type GoogleConsentModeStatus } from './NativeCmSdkReactNativeV3';
2
+ declare const CmSdkReactNativeV3: import("./NativeCmSdkReactNativeV3").Spec;
3
+ export declare const addConsentListener: (callback: (consent: string, jsonObject: Object) => void) => import("react-native").EmitterSubscription;
3
4
  export declare const addShowConsentLayerListener: (callback: () => void) => import("react-native").EmitterSubscription;
4
5
  export declare const addCloseConsentLayerListener: (callback: () => void) => import("react-native").EmitterSubscription;
5
6
  export declare const addErrorListener: (callback: (error: string) => void) => import("react-native").EmitterSubscription;
6
7
  export declare const addClickLinkListener: (callback: (url: string) => void) => import("react-native").EmitterSubscription;
7
- export declare const setUrlConfig: any;
8
- export declare const setWebViewConfig: any;
9
- export declare const checkAndOpen: any;
10
- export declare const forceOpen: any;
11
- export declare const jumpToSettings: any;
12
- export declare const getUserStatus: any;
13
- export declare const getStatusForPurpose: any;
14
- export declare const getStatusForVendor: any;
15
- export declare const getGoogleConsentModeStatus: any;
16
- export declare const exportCMPInfo: any;
17
- export declare const importCMPInfo: any;
18
- export declare const resetConsentManagementData: any;
19
- export declare const acceptVendors: any;
20
- export declare const rejectVendors: any;
21
- export declare const acceptPurposes: any;
22
- export declare const rejectPurposes: any;
23
- export declare const rejectAll: any;
24
- export declare const acceptAll: any;
25
- export declare const checkWithServerAndOpenIfNecessary: any;
26
- export declare const openConsentLayer: any;
27
- export declare const checkIfConsentIsRequired: any;
28
- export declare const hasUserChoice: any;
29
- export declare const hasPurposeConsent: any;
30
- export declare const hasVendorConsent: any;
31
- export declare const getAllPurposesIDs: any;
32
- export declare const getEnabledPurposesIDs: any;
33
- export declare const getDisabledPurposesIDs: any;
34
- export declare const getAllVendorsIDs: any;
35
- export declare const getEnabledVendorsIDs: any;
36
- export declare const getDisabledVendorsIDs: any;
8
+ export declare const addATTStatusChangeListener: (callback: (event: ATTStatusChangeEvent) => void) => import("react-native").EmitterSubscription;
9
+ export declare const setUrlConfig: (config: UrlConfig) => Promise<void>;
10
+ export declare const setWebViewConfig: (config: WebViewConfig) => Promise<void>;
11
+ export declare const setATTStatus: (status: number) => Promise<void>;
12
+ export declare const checkAndOpen: (jumpToSettings: boolean) => Promise<boolean>;
13
+ export declare const forceOpen: (jumpToSettings: boolean) => Promise<boolean>;
14
+ export declare const getUserStatus: () => Promise<UserStatus>;
15
+ export declare const getStatusForPurpose: (purposeId: string) => Promise<string>;
16
+ export declare const getStatusForVendor: (vendorId: string) => Promise<string>;
17
+ export declare const getGoogleConsentModeStatus: () => Promise<GoogleConsentModeStatus>;
18
+ export declare const exportCMPInfo: () => Promise<string>;
19
+ export declare const importCMPInfo: (cmpString: string) => Promise<boolean>;
20
+ export declare const resetConsentManagementData: () => Promise<boolean>;
21
+ export declare const acceptVendors: (vendors: string[]) => Promise<boolean>;
22
+ export declare const rejectVendors: (vendors: string[]) => Promise<boolean>;
23
+ export declare const acceptPurposes: (purposes: string[], updatePurpose: boolean) => Promise<boolean>;
24
+ export declare const rejectPurposes: (purposes: string[], updateVendor: boolean) => Promise<boolean>;
25
+ export declare const rejectAll: () => Promise<boolean>;
26
+ export declare const acceptAll: () => Promise<boolean>;
27
+ export type { ConsentReceivedEvent, ErrorEvent, LinkClickEvent, ATTStatusChangeEvent, UrlConfig, WebViewConfig, UserStatus, GoogleConsentModeStatus, };
37
28
  export default CmSdkReactNativeV3;
38
29
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.tsx"],"names":[],"m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EAAE,EAAE,cAAc,OAAO,KAAG,OAAO,CAAC,OAAO,CAEzF,CAAC;AAEF,eAAO,MAAM,SAAS,QAAO,OAAO,CAAC,OAAO,CAE3C,CAAC;AAEF,eAAO,MAAM,SAAS,QAAO,OAAO,CAAC,OAAO,CAE3C,CAAC;AAGF,YAAY,EACV,oBAAoB,EACpB,UAAU,EACV,cAAc,EACd,oBAAoB,EACpB,SAAS,EACT,aAAa,EACb,UAAU,EACV,uBAAuB,GACxB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cm-sdk-react-native-v3",
3
- "version": "3.5.3",
3
+ "version": "3.6.0",
4
4
  "description": "Consent Management React Native Library by consentmanager.net",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/commonjs/index.js",
@@ -175,5 +175,10 @@
175
175
  "type": "module-legacy",
176
176
  "languages": "kotlin-swift",
177
177
  "version": "0.41.2"
178
+ },
179
+ "codegenConfig": {
180
+ "name": "CmSdkReactNativeV3Spec",
181
+ "type": "modules",
182
+ "jsSrcsDir": "src"
178
183
  }
179
184
  }
@@ -15,7 +15,7 @@ Pod::Spec.new do |s|
15
15
  s.source = { :git => "https://github.com/iubenda/cm-sdk-react-native-v3.git", :tag => "#{s.version}" }
16
16
 
17
17
  s.source_files = "ios/**/*.{h,m,mm,swift}"
18
- s.dependency "cm-sdk-ios-v3", "3.5.2"
18
+ s.dependency "cm-sdk-ios-v3", "3.6.0"
19
19
 
20
20
  # Use install_modules_dependencies helper to install the dependencies if React Native version >=0.71.0.
21
21
  # See https://github.com/facebook/react-native/blob/febf6b7f33fdb4904669f99d795eba4c0f95d7bf/scripts/cocoapods/new_architecture.rb#L79.
@@ -0,0 +1,92 @@
1
+ import type { TurboModule } from 'react-native';
2
+ import { TurboModuleRegistry } from 'react-native';
3
+
4
+ // Event payload types for better TypeScript support
5
+ export type ConsentReceivedEvent = {
6
+ consent: string;
7
+ jsonObject: Object;
8
+ };
9
+
10
+ export type ErrorEvent = {
11
+ error: string;
12
+ };
13
+
14
+ export type LinkClickEvent = {
15
+ url: string;
16
+ };
17
+
18
+ export type ATTStatusChangeEvent = {
19
+ oldStatus: number;
20
+ newStatus: number;
21
+ lastUpdated: number;
22
+ };
23
+
24
+ // Additional type definitions for better TypeScript support
25
+ export type UrlConfig = {
26
+ id: string;
27
+ domain: string;
28
+ language: string;
29
+ appName: string;
30
+ noHash?: boolean;
31
+ };
32
+
33
+ export type WebViewConfig = {
34
+ position?: string;
35
+ cornerRadius?: number;
36
+ respectsSafeArea?: boolean;
37
+ allowsOrientationChanges?: boolean;
38
+ backgroundStyle?: {
39
+ type?: string;
40
+ color?: string;
41
+ opacity?: number;
42
+ };
43
+ };
44
+
45
+ export type UserStatus = {
46
+ status: string;
47
+ vendors: Object;
48
+ purposes: Object;
49
+ tcf: string;
50
+ addtlConsent: string;
51
+ regulation: string;
52
+ };
53
+
54
+ export type GoogleConsentModeStatus = Object;
55
+
56
+ export interface Spec extends TurboModule {
57
+ // Configuration methods
58
+ setUrlConfig(config: UrlConfig): Promise<void>;
59
+
60
+ setWebViewConfig(config: WebViewConfig): Promise<void>;
61
+
62
+ // iOS-only ATT status method
63
+ setATTStatus(status: number): Promise<void>;
64
+
65
+ // Main interaction methods
66
+ checkAndOpen(jumpToSettings: boolean): Promise<boolean>;
67
+ forceOpen(jumpToSettings: boolean): Promise<boolean>;
68
+
69
+ // Consent status methods
70
+ getUserStatus(): Promise<UserStatus>;
71
+
72
+ getStatusForPurpose(purposeId: string): Promise<string>;
73
+ getStatusForVendor(vendorId: string): Promise<string>;
74
+ getGoogleConsentModeStatus(): Promise<GoogleConsentModeStatus>;
75
+ exportCMPInfo(): Promise<string>;
76
+ importCMPInfo(cmpString: string): Promise<boolean>;
77
+ resetConsentManagementData(): Promise<boolean>;
78
+
79
+ // Consent modification methods
80
+ acceptVendors(vendors: string[]): Promise<boolean>;
81
+ rejectVendors(vendors: string[]): Promise<boolean>;
82
+ acceptPurposes(purposes: string[], updatePurpose: boolean): Promise<boolean>;
83
+ rejectPurposes(purposes: string[], updateVendor: boolean): Promise<boolean>;
84
+ rejectAll(): Promise<boolean>;
85
+ acceptAll(): Promise<boolean>;
86
+
87
+ // Event emitter methods (required for TurboModule)
88
+ addListener(eventName: string): void;
89
+ removeListeners(count: number): void;
90
+ }
91
+
92
+ export default TurboModuleRegistry.getEnforcing<Spec>('CmSdkReactNativeV3');
package/src/index.tsx CHANGED
@@ -1,4 +1,14 @@
1
1
  import { NativeModules, Platform, NativeEventEmitter } from 'react-native';
2
+ import NativeCmSdkReactNativeV3, {
3
+ type ConsentReceivedEvent,
4
+ type ErrorEvent,
5
+ type LinkClickEvent,
6
+ type ATTStatusChangeEvent,
7
+ type UrlConfig,
8
+ type WebViewConfig,
9
+ type UserStatus,
10
+ type GoogleConsentModeStatus,
11
+ } from './NativeCmSdkReactNativeV3';
2
12
 
3
13
  const LINKING_ERROR =
4
14
  `The package 'react-native-cm-sdk-react-native-v3' doesn't seem to be linked. Make sure: \n\n` +
@@ -6,7 +16,8 @@ const LINKING_ERROR =
6
16
  '- You rebuilt the app after installing the package\n' +
7
17
  '- You are not using Expo Go\n';
8
18
 
9
- const CmSdkReactNativeV3 = NativeModules.CmSdkReactNativeV3
19
+ // Use TurboModule if available (New Architecture), fallback to legacy NativeModules
20
+ const CmSdkReactNativeV3 = NativeCmSdkReactNativeV3 ?? (NativeModules.CmSdkReactNativeV3
10
21
  ? NativeModules.CmSdkReactNativeV3
11
22
  : new Proxy(
12
23
  {},
@@ -15,14 +26,14 @@ const CmSdkReactNativeV3 = NativeModules.CmSdkReactNativeV3
15
26
  throw new Error(LINKING_ERROR);
16
27
  },
17
28
  }
18
- );
29
+ ));
19
30
 
20
31
  const eventEmitter = new NativeEventEmitter(CmSdkReactNativeV3);
21
32
 
22
33
  export const addConsentListener = (
23
- callback: (consent: string, jsonObject: any) => void
34
+ callback: (consent: string, jsonObject: Object) => void
24
35
  ) => {
25
- return eventEmitter.addListener('didReceiveConsent', (event) => {
36
+ return eventEmitter.addListener('didReceiveConsent', (event: ConsentReceivedEvent) => {
26
37
  callback(event.consent, event.jsonObject);
27
38
  });
28
39
  };
@@ -36,55 +47,107 @@ export const addCloseConsentLayerListener = (callback: () => void) => {
36
47
  };
37
48
 
38
49
  export const addErrorListener = (callback: (error: string) => void) => {
39
- return eventEmitter.addListener('didReceiveError', (event) => {
50
+ return eventEmitter.addListener('didReceiveError', (event: ErrorEvent) => {
40
51
  callback(event.error);
41
52
  });
42
53
  };
43
54
 
44
55
  export const addClickLinkListener = (callback: (url: string) => void) => {
45
- return eventEmitter.addListener('onClickLink', (event) => {
56
+ return eventEmitter.addListener('onClickLink', (event: LinkClickEvent) => {
46
57
  callback(event.url);
47
58
  });
48
59
  };
49
60
 
61
+ export const addATTStatusChangeListener = (callback: (event: ATTStatusChangeEvent) => void) => {
62
+ return eventEmitter.addListener('didChangeATTStatus', callback);
63
+ };
64
+
50
65
  // Core configuration methods
51
- export const setUrlConfig = CmSdkReactNativeV3.setUrlConfig;
52
- export const setWebViewConfig = CmSdkReactNativeV3.setWebViewConfig;
66
+ export const setUrlConfig = (config: UrlConfig): Promise<void> => {
67
+ return CmSdkReactNativeV3.setUrlConfig(config);
68
+ };
69
+
70
+ export const setWebViewConfig = (config: WebViewConfig): Promise<void> => {
71
+ return CmSdkReactNativeV3.setWebViewConfig(config);
72
+ };
73
+
74
+ export const setATTStatus = (status: number): Promise<void> => {
75
+ return CmSdkReactNativeV3.setATTStatus(status);
76
+ };
77
+
78
+ // Main interaction methods
79
+ export const checkAndOpen = (jumpToSettings: boolean): Promise<boolean> => {
80
+ return CmSdkReactNativeV3.checkAndOpen(jumpToSettings);
81
+ };
53
82
 
54
- // Main interaction methods (new API)
55
- export const checkAndOpen = CmSdkReactNativeV3.checkAndOpen;
56
- export const forceOpen = CmSdkReactNativeV3.forceOpen;
57
- export const jumpToSettings = CmSdkReactNativeV3.jumpToSettings;
83
+ export const forceOpen = (jumpToSettings: boolean): Promise<boolean> => {
84
+ return CmSdkReactNativeV3.forceOpen(jumpToSettings);
85
+ };
58
86
 
59
87
  // Consent status methods
60
- export const getUserStatus = CmSdkReactNativeV3.getUserStatus;
61
- export const getStatusForPurpose = CmSdkReactNativeV3.getStatusForPurpose;
62
- export const getStatusForVendor = CmSdkReactNativeV3.getStatusForVendor;
63
- export const getGoogleConsentModeStatus = CmSdkReactNativeV3.getGoogleConsentModeStatus;
64
- export const exportCMPInfo = CmSdkReactNativeV3.exportCMPInfo;
65
- export const importCMPInfo = CmSdkReactNativeV3.importCMPInfo;
66
- export const resetConsentManagementData = CmSdkReactNativeV3.resetConsentManagementData;
88
+ export const getUserStatus = (): Promise<UserStatus> => {
89
+ return CmSdkReactNativeV3.getUserStatus();
90
+ };
91
+
92
+ export const getStatusForPurpose = (purposeId: string): Promise<string> => {
93
+ return CmSdkReactNativeV3.getStatusForPurpose(purposeId);
94
+ };
95
+
96
+ export const getStatusForVendor = (vendorId: string): Promise<string> => {
97
+ return CmSdkReactNativeV3.getStatusForVendor(vendorId);
98
+ };
99
+
100
+ export const getGoogleConsentModeStatus = (): Promise<GoogleConsentModeStatus> => {
101
+ return CmSdkReactNativeV3.getGoogleConsentModeStatus();
102
+ };
103
+
104
+ export const exportCMPInfo = (): Promise<string> => {
105
+ return CmSdkReactNativeV3.exportCMPInfo();
106
+ };
107
+
108
+ export const importCMPInfo = (cmpString: string): Promise<boolean> => {
109
+ return CmSdkReactNativeV3.importCMPInfo(cmpString);
110
+ };
111
+
112
+ export const resetConsentManagementData = (): Promise<boolean> => {
113
+ return CmSdkReactNativeV3.resetConsentManagementData();
114
+ };
67
115
 
68
116
  // Consent modification methods
69
- export const acceptVendors = CmSdkReactNativeV3.acceptVendors;
70
- export const rejectVendors = CmSdkReactNativeV3.rejectVendors;
71
- export const acceptPurposes = CmSdkReactNativeV3.acceptPurposes;
72
- export const rejectPurposes = CmSdkReactNativeV3.rejectPurposes;
73
- export const rejectAll = CmSdkReactNativeV3.rejectAll;
74
- export const acceptAll = CmSdkReactNativeV3.acceptAll;
75
-
76
- // Deprecated methods (kept for backward compatibility)
77
- export const checkWithServerAndOpenIfNecessary = CmSdkReactNativeV3.checkWithServerAndOpenIfNecessary;
78
- export const openConsentLayer = CmSdkReactNativeV3.openConsentLayer;
79
- export const checkIfConsentIsRequired = CmSdkReactNativeV3.checkIfConsentIsRequired;
80
- export const hasUserChoice = CmSdkReactNativeV3.hasUserChoice;
81
- export const hasPurposeConsent = CmSdkReactNativeV3.hasPurposeConsent;
82
- export const hasVendorConsent = CmSdkReactNativeV3.hasVendorConsent;
83
- export const getAllPurposesIDs = CmSdkReactNativeV3.getAllPurposesIDs;
84
- export const getEnabledPurposesIDs = CmSdkReactNativeV3.getEnabledPurposesIDs;
85
- export const getDisabledPurposesIDs = CmSdkReactNativeV3.getDisabledPurposesIDs;
86
- export const getAllVendorsIDs = CmSdkReactNativeV3.getAllVendorsIDs;
87
- export const getEnabledVendorsIDs = CmSdkReactNativeV3.getEnabledVendorsIDs;
88
- export const getDisabledVendorsIDs = CmSdkReactNativeV3.getDisabledVendorsIDs;
117
+ export const acceptVendors = (vendors: string[]): Promise<boolean> => {
118
+ return CmSdkReactNativeV3.acceptVendors(vendors);
119
+ };
120
+
121
+ export const rejectVendors = (vendors: string[]): Promise<boolean> => {
122
+ return CmSdkReactNativeV3.rejectVendors(vendors);
123
+ };
124
+
125
+ export const acceptPurposes = (purposes: string[], updatePurpose: boolean): Promise<boolean> => {
126
+ return CmSdkReactNativeV3.acceptPurposes(purposes, updatePurpose);
127
+ };
128
+
129
+ export const rejectPurposes = (purposes: string[], updateVendor: boolean): Promise<boolean> => {
130
+ return CmSdkReactNativeV3.rejectPurposes(purposes, updateVendor);
131
+ };
132
+
133
+ export const rejectAll = (): Promise<boolean> => {
134
+ return CmSdkReactNativeV3.rejectAll();
135
+ };
136
+
137
+ export const acceptAll = (): Promise<boolean> => {
138
+ return CmSdkReactNativeV3.acceptAll();
139
+ };
140
+
141
+ // Re-export types for consumer convenience
142
+ export type {
143
+ ConsentReceivedEvent,
144
+ ErrorEvent,
145
+ LinkClickEvent,
146
+ ATTStatusChangeEvent,
147
+ UrlConfig,
148
+ WebViewConfig,
149
+ UserStatus,
150
+ GoogleConsentModeStatus,
151
+ };
89
152
 
90
153
  export default CmSdkReactNativeV3;