@kontextso/sdk-react-native 3.3.0-rc.3 → 3.3.0-rc.4
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.
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +533 -526
- package/dist/index.mjs +471 -504
- package/package.json +1 -1
- package/src/NativeRNKontext.ts +1 -1
- package/src/context/AdsProvider.tsx +8 -2
package/package.json
CHANGED
package/src/NativeRNKontext.ts
CHANGED
|
@@ -7,7 +7,7 @@ export interface Spec extends TurboModule {
|
|
|
7
7
|
dismissSKOverlay(): Promise<boolean>
|
|
8
8
|
presentSKStoreProduct(appStoreId: string): Promise<boolean>
|
|
9
9
|
dismissSKStoreProduct(): Promise<boolean>
|
|
10
|
-
getTcfData(): Promise<{ gdprApplies: 0 | 1 | undefined
|
|
10
|
+
getTcfData(): Promise<{ gdprApplies: 0 | 1 | undefined; tcString: string | undefined }>
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export default TurboModuleRegistry.getEnforcing<Spec>('RNKontext')
|
|
@@ -125,9 +125,15 @@ const getSdk = async (): Promise<SDKConfig> => ({
|
|
|
125
125
|
const getTcf = async (): Promise<Pick<RegulatoryConfig, 'gdpr' | 'gdprConsent'>> => {
|
|
126
126
|
try {
|
|
127
127
|
const tcfData = await NativeRNKontext.getTcfData()
|
|
128
|
+
|
|
129
|
+
const gdpr = tcfData.gdprApplies === 0 || tcfData.gdprApplies === 1 ? tcfData.gdprApplies : undefined
|
|
130
|
+
|
|
131
|
+
const gdprConsent =
|
|
132
|
+
typeof tcfData.tcString === 'string' && tcfData.tcString.length > 0 ? tcfData.tcString : undefined
|
|
133
|
+
|
|
128
134
|
return {
|
|
129
|
-
gdpr:
|
|
130
|
-
gdprConsent:
|
|
135
|
+
...(gdpr !== undefined ? { gdpr } : {}),
|
|
136
|
+
...(gdprConsent !== undefined ? { gdprConsent } : {}),
|
|
131
137
|
}
|
|
132
138
|
} catch (error) {
|
|
133
139
|
console.error(error)
|