@osano/osano-cmp-react-native 0.12.0 → 0.13.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.
- package/README.dev.md +216 -1
- package/README.md +2 -268
- package/android/src/main/java/com/OsanoCMPSDK/OsanoCMPSDKModule.kt +41 -0
- package/ios/OsanoCmpSDK.mm +42 -0
- package/lib/commonjs/ConsentManager.js +57 -14
- package/lib/commonjs/ConsentManager.js.map +1 -1
- package/lib/commonjs/ConsentUiBuilder.js +10 -7
- package/lib/commonjs/ConsentUiBuilder.js.map +1 -1
- package/lib/commonjs/commands.js +10 -5
- package/lib/commonjs/commands.js.map +1 -1
- package/lib/commonjs/components/Button.js +6 -7
- package/lib/commonjs/components/Button.js.map +1 -1
- package/lib/commonjs/components/Checkbox.js +1 -2
- package/lib/commonjs/components/Checkbox.js.map +1 -1
- package/lib/commonjs/components/ExpansionPanel.js +1 -2
- package/lib/commonjs/components/ExpansionPanel.js.map +1 -1
- package/lib/commonjs/components/Link.js +1 -2
- package/lib/commonjs/components/Link.js.map +1 -1
- package/lib/commonjs/components/StoragePolicyLink.js +1 -2
- package/lib/commonjs/components/StoragePolicyLink.js.map +1 -1
- package/lib/commonjs/components/Toggle.js +1 -2
- package/lib/commonjs/components/Toggle.js.map +1 -1
- package/lib/commonjs/context.js +5 -4
- package/lib/commonjs/context.js.map +1 -1
- package/lib/commonjs/iab/tcf/constants.js +34 -1
- package/lib/commonjs/iab/tcf/constants.js.map +1 -1
- package/lib/commonjs/iab/tcf/iab-storage-utils.js +102 -0
- package/lib/commonjs/iab/tcf/iab-storage-utils.js.map +1 -0
- package/lib/commonjs/iab/tcf/index.js +1 -2
- package/lib/commonjs/iab/tcf/index.js.map +1 -1
- package/lib/commonjs/iab/tcf/middleware.js +33 -35
- package/lib/commonjs/iab/tcf/middleware.js.map +1 -1
- package/lib/commonjs/iab/tcf/selectors.js +1 -1
- package/lib/commonjs/iab/tcf/selectors.js.map +1 -1
- package/lib/commonjs/iab/tcf/v2.0/shared-constants.js +1 -2
- package/lib/commonjs/iab/tcf/v2.0/shared-constants.js.map +1 -1
- package/lib/commonjs/index.js +29 -9
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/locale/af.json +342 -323
- package/lib/commonjs/locale/ar.json +342 -323
- package/lib/commonjs/locale/bg.json +342 -323
- package/lib/commonjs/locale/ca.json +342 -323
- package/lib/commonjs/locale/cs.json +342 -323
- package/lib/commonjs/locale/da.json +342 -323
- package/lib/commonjs/locale/de-at.json +342 -323
- package/lib/commonjs/locale/de.json +342 -323
- package/lib/commonjs/locale/el.json +342 -323
- package/lib/commonjs/locale/en-au.json +342 -323
- package/lib/commonjs/locale/en-ca.json +342 -323
- package/lib/commonjs/locale/en-gb.json +342 -323
- package/lib/commonjs/locale/en.json +342 -323
- package/lib/commonjs/locale/es-mx.json +342 -323
- package/lib/commonjs/locale/es.json +342 -323
- package/lib/commonjs/locale/et.json +342 -323
- package/lib/commonjs/locale/fa.json +342 -323
- package/lib/commonjs/locale/fi.json +342 -323
- package/lib/commonjs/locale/fr-ca.json +342 -323
- package/lib/commonjs/locale/fr.json +342 -323
- package/lib/commonjs/locale/gd.json +342 -323
- package/lib/commonjs/locale/he.json +342 -323
- package/lib/commonjs/locale/hi.json +342 -323
- package/lib/commonjs/locale/hr.json +342 -323
- package/lib/commonjs/locale/hu.json +342 -323
- package/lib/commonjs/locale/hy.json +342 -323
- package/lib/commonjs/locale/id.json +342 -323
- package/lib/commonjs/locale/is.json +342 -323
- package/lib/commonjs/locale/it.json +342 -323
- package/lib/commonjs/locale/ja.json +342 -323
- package/lib/commonjs/locale/kk.json +342 -323
- package/lib/commonjs/locale/ko.json +342 -323
- package/lib/commonjs/locale/lt.json +342 -323
- package/lib/commonjs/locale/lv.json +342 -323
- package/lib/commonjs/locale/mi.json +342 -323
- package/lib/commonjs/locale/ms.json +342 -323
- package/lib/commonjs/locale/nb.json +342 -323
- package/lib/commonjs/locale/nl-be.json +342 -323
- package/lib/commonjs/locale/nl.json +342 -323
- package/lib/commonjs/locale/nn.json +342 -323
- package/lib/commonjs/locale/no.json +342 -323
- package/lib/commonjs/locale/pl.json +342 -323
- package/lib/commonjs/locale/pt-br.json +342 -323
- package/lib/commonjs/locale/pt.json +342 -323
- package/lib/commonjs/locale/ro.json +342 -323
- package/lib/commonjs/locale/ru.json +342 -323
- package/lib/commonjs/locale/sk.json +342 -323
- package/lib/commonjs/locale/sl.json +342 -323
- package/lib/commonjs/locale/sq.json +342 -323
- package/lib/commonjs/locale/sr.json +342 -323
- package/lib/commonjs/locale/sv.json +342 -323
- package/lib/commonjs/locale/th.json +342 -323
- package/lib/commonjs/locale/tl.json +342 -323
- package/lib/commonjs/locale/tr.json +342 -323
- package/lib/commonjs/locale/uk.json +342 -323
- package/lib/commonjs/locale/vi.json +342 -323
- package/lib/commonjs/locale/zh-hk.json +342 -323
- package/lib/commonjs/locale/zh-tw.json +342 -323
- package/lib/commonjs/locale/zh.json +342 -323
- package/lib/commonjs/locale/zu.json +342 -323
- package/lib/commonjs/native/OsanoCmp.js +16 -0
- package/lib/commonjs/native/OsanoCmp.js.map +1 -1
- package/lib/commonjs/services/consent.js +6 -5
- package/lib/commonjs/services/consent.js.map +1 -1
- package/lib/commonjs/services/google-consent-mode-mapper.js +109 -0
- package/lib/commonjs/services/google-consent-mode-mapper.js.map +1 -0
- package/lib/commonjs/types/google-consent-mode.js +73 -0
- package/lib/commonjs/types/google-consent-mode.js.map +1 -0
- package/lib/commonjs/utils/OsanoLogger.js +51 -0
- package/lib/commonjs/utils/OsanoLogger.js.map +1 -0
- package/lib/commonjs/utils/index.js +7 -0
- package/lib/commonjs/utils/index.js.map +1 -1
- package/lib/commonjs/views/Dialog/Buttons.js +1 -2
- package/lib/commonjs/views/Dialog/Buttons.js.map +1 -1
- package/lib/commonjs/views/Dialog/FirstLayerUsage.js +1 -2
- package/lib/commonjs/views/Dialog/FirstLayerUsage.js.map +1 -1
- package/lib/commonjs/views/Dialog/Message.js +1 -2
- package/lib/commonjs/views/Dialog/Message.js.map +1 -1
- package/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.js +1 -2
- package/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.js.map +1 -1
- package/lib/commonjs/views/Dialog/index.js +1 -2
- package/lib/commonjs/views/Dialog/index.js.map +1 -1
- package/lib/commonjs/views/Drawer/Drawer.ConsentCategories.js +1 -2
- package/lib/commonjs/views/Drawer/Drawer.ConsentCategories.js.map +1 -1
- package/lib/commonjs/views/Drawer/Drawer.Header.js +1 -2
- package/lib/commonjs/views/Drawer/Drawer.Header.js.map +1 -1
- package/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.js +1 -2
- package/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.js.map +1 -1
- package/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.js +1 -2
- package/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.js.map +1 -1
- package/lib/commonjs/views/Drawer/index.js +1 -2
- package/lib/commonjs/views/Drawer/index.js.map +1 -1
- package/lib/module/ConsentManager.js +56 -12
- package/lib/module/ConsentManager.js.map +1 -1
- package/lib/module/ConsentUiBuilder.js +9 -5
- package/lib/module/ConsentUiBuilder.js.map +1 -1
- package/lib/module/commands.js +10 -5
- package/lib/module/commands.js.map +1 -1
- package/lib/module/components/Button.js +5 -5
- package/lib/module/components/Button.js.map +1 -1
- package/lib/module/context.js +5 -4
- package/lib/module/context.js.map +1 -1
- package/lib/module/iab/tcf/constants.js +32 -0
- package/lib/module/iab/tcf/constants.js.map +1 -1
- package/lib/module/iab/tcf/iab-storage-utils.js +89 -0
- package/lib/module/iab/tcf/iab-storage-utils.js.map +1 -0
- package/lib/module/iab/tcf/middleware.js +25 -27
- package/lib/module/iab/tcf/middleware.js.map +1 -1
- package/lib/module/iab/tcf/selectors.js +1 -1
- package/lib/module/iab/tcf/selectors.js.map +1 -1
- package/lib/module/index.js +22 -7
- package/lib/module/index.js.map +1 -1
- package/lib/module/locale/af.json +342 -323
- package/lib/module/locale/ar.json +342 -323
- package/lib/module/locale/bg.json +342 -323
- package/lib/module/locale/ca.json +342 -323
- package/lib/module/locale/cs.json +342 -323
- package/lib/module/locale/da.json +342 -323
- package/lib/module/locale/de-at.json +342 -323
- package/lib/module/locale/de.json +342 -323
- package/lib/module/locale/el.json +342 -323
- package/lib/module/locale/en-au.json +342 -323
- package/lib/module/locale/en-ca.json +342 -323
- package/lib/module/locale/en-gb.json +342 -323
- package/lib/module/locale/en.json +342 -323
- package/lib/module/locale/es-mx.json +342 -323
- package/lib/module/locale/es.json +342 -323
- package/lib/module/locale/et.json +342 -323
- package/lib/module/locale/fa.json +342 -323
- package/lib/module/locale/fi.json +342 -323
- package/lib/module/locale/fr-ca.json +342 -323
- package/lib/module/locale/fr.json +342 -323
- package/lib/module/locale/gd.json +342 -323
- package/lib/module/locale/he.json +342 -323
- package/lib/module/locale/hi.json +342 -323
- package/lib/module/locale/hr.json +342 -323
- package/lib/module/locale/hu.json +342 -323
- package/lib/module/locale/hy.json +342 -323
- package/lib/module/locale/id.json +342 -323
- package/lib/module/locale/is.json +342 -323
- package/lib/module/locale/it.json +342 -323
- package/lib/module/locale/ja.json +342 -323
- package/lib/module/locale/kk.json +342 -323
- package/lib/module/locale/ko.json +342 -323
- package/lib/module/locale/lt.json +342 -323
- package/lib/module/locale/lv.json +342 -323
- package/lib/module/locale/mi.json +342 -323
- package/lib/module/locale/ms.json +342 -323
- package/lib/module/locale/nb.json +342 -323
- package/lib/module/locale/nl-be.json +342 -323
- package/lib/module/locale/nl.json +342 -323
- package/lib/module/locale/nn.json +342 -323
- package/lib/module/locale/no.json +342 -323
- package/lib/module/locale/pl.json +342 -323
- package/lib/module/locale/pt-br.json +342 -323
- package/lib/module/locale/pt.json +342 -323
- package/lib/module/locale/ro.json +342 -323
- package/lib/module/locale/ru.json +342 -323
- package/lib/module/locale/sk.json +342 -323
- package/lib/module/locale/sl.json +342 -323
- package/lib/module/locale/sq.json +342 -323
- package/lib/module/locale/sr.json +342 -323
- package/lib/module/locale/sv.json +342 -323
- package/lib/module/locale/th.json +342 -323
- package/lib/module/locale/tl.json +342 -323
- package/lib/module/locale/tr.json +342 -323
- package/lib/module/locale/uk.json +342 -323
- package/lib/module/locale/vi.json +342 -323
- package/lib/module/locale/zh-hk.json +342 -323
- package/lib/module/locale/zh-tw.json +342 -323
- package/lib/module/locale/zh.json +342 -323
- package/lib/module/locale/zu.json +342 -323
- package/lib/module/native/OsanoCmp.js +12 -0
- package/lib/module/native/OsanoCmp.js.map +1 -1
- package/lib/module/services/consent.js +6 -6
- package/lib/module/services/consent.js.map +1 -1
- package/lib/module/services/google-consent-mode-mapper.js +103 -0
- package/lib/module/services/google-consent-mode-mapper.js.map +1 -0
- package/lib/module/types/google-consent-mode.js +70 -0
- package/lib/module/types/google-consent-mode.js.map +1 -0
- package/lib/module/utils/OsanoLogger.js +44 -0
- package/lib/module/utils/OsanoLogger.js.map +1 -0
- package/lib/module/utils/index.js +1 -0
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/lib/commonjs/ConsentManager.d.ts +15 -0
- package/lib/typescript/lib/commonjs/ConsentManager.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/ConsentUiBuilder.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/commands.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/Button.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/Checkbox.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/ExpansionPanel.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/Link.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/StoragePolicyLink.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/components/Toggle.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/constants.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/gpp/api.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/gpp/consent.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/gpp/v1/index.d.ts +1 -3
- package/lib/typescript/lib/commonjs/iab/gpp/v1/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/tcf/consent.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/tcf/constants.d.ts +41 -1
- package/lib/typescript/lib/commonjs/iab/tcf/constants.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/tcf/iab-storage-utils.d.ts +9 -0
- package/lib/typescript/lib/commonjs/iab/tcf/iab-storage-utils.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/iab/tcf/middleware.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/tcf/reducer.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/tcf/selectors.d.ts +0 -1
- package/lib/typescript/lib/commonjs/iab/tcf/selectors.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/tcf/v2.0/shared-constants.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/usp/api.d.ts +1 -1
- package/lib/typescript/lib/commonjs/iab/usp/api.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/usp/consent.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/usp/selectors.d.ts +1 -4
- package/lib/typescript/lib/commonjs/iab/usp/selectors.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/iab/usp/v1/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/index.d.ts +2 -0
- package/lib/typescript/lib/commonjs/native/OsanoCmp.d.ts +4 -0
- package/lib/typescript/lib/commonjs/native/OsanoCmp.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/reducer.d.ts +7 -1
- package/lib/typescript/lib/commonjs/reducer.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/services/consent.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/services/google-consent-mode-mapper.d.ts +72 -0
- package/lib/typescript/lib/commonjs/services/google-consent-mode-mapper.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/types/google-consent-mode.d.ts +32 -0
- package/lib/typescript/lib/commonjs/types/google-consent-mode.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/utils/OsanoLogger.d.ts +16 -0
- package/lib/typescript/lib/commonjs/utils/OsanoLogger.d.ts.map +1 -0
- package/lib/typescript/lib/commonjs/utils/Translator.d.ts +1 -1
- package/lib/typescript/lib/commonjs/utils/Translator.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/utils/index.d.ts +2 -0
- package/lib/typescript/lib/commonjs/utils/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Dialog/Buttons.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Dialog/FirstLayerUsage.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Dialog/Message.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Dialog/PreferenceManagementDeepLinks.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Dialog/index.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.ConsentCategories.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Header.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Iab.Disclosures.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Drawer/Drawer.Iab.Vendors.d.ts.map +1 -1
- package/lib/typescript/lib/commonjs/views/Drawer/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/ConsentManager.d.ts +17 -2
- package/lib/typescript/lib/module/ConsentManager.d.ts.map +1 -1
- package/lib/typescript/lib/module/ConsentUiBuilder.d.ts +1 -0
- package/lib/typescript/lib/module/ConsentUiBuilder.d.ts.map +1 -1
- package/lib/typescript/lib/module/actions.d.ts.map +1 -1
- package/lib/typescript/lib/module/commands.d.ts +1 -1
- package/lib/typescript/lib/module/commands.d.ts.map +1 -1
- package/lib/typescript/lib/module/components/Button.d.ts.map +1 -1
- package/lib/typescript/lib/module/constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/context.d.ts +9 -1
- package/lib/typescript/lib/module/context.d.ts.map +1 -1
- package/lib/typescript/lib/module/flavors/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/gpp/api.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/gpp/consent.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/gpp/v1/constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/gpp/v1/index.d.ts +1 -3
- package/lib/typescript/lib/module/iab/gpp/v1/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/consent.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/constants.d.ts +41 -1
- package/lib/typescript/lib/module/iab/tcf/constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/iab-storage-utils.d.ts +8 -0
- package/lib/typescript/lib/module/iab/tcf/iab-storage-utils.d.ts.map +1 -0
- package/lib/typescript/lib/module/iab/tcf/index.d.ts +0 -2
- package/lib/typescript/lib/module/iab/tcf/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/middleware.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/reducer.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/selectors.d.ts +0 -1
- package/lib/typescript/lib/module/iab/tcf/selectors.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/v2.0/index.d.ts +0 -2
- package/lib/typescript/lib/module/iab/tcf/v2.0/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/v2.0/shared-constants.d.ts +0 -1
- package/lib/typescript/lib/module/iab/tcf/v2.0/shared-constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/v2.0/tcfcav1-constants.d.ts +5 -2
- package/lib/typescript/lib/module/iab/tcf/v2.0/tcfcav1-constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/tcf/v2.0/tcfeuv2-constants.d.ts +0 -1
- package/lib/typescript/lib/module/iab/tcf/v2.0/tcfeuv2-constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/usp/api.d.ts +1 -1
- package/lib/typescript/lib/module/iab/usp/api.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/usp/consent.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/usp/selectors.d.ts +1 -4
- package/lib/typescript/lib/module/iab/usp/selectors.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/usp/v1/constants.d.ts.map +1 -1
- package/lib/typescript/lib/module/iab/usp/v1/index.d.ts +1 -1
- package/lib/typescript/lib/module/iab/usp/v1/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/index.d.ts +1 -0
- package/lib/typescript/lib/module/index.d.ts.map +1 -1
- package/lib/typescript/lib/module/native/OsanoCmp.d.ts +4 -0
- package/lib/typescript/lib/module/native/OsanoCmp.d.ts.map +1 -1
- package/lib/typescript/lib/module/reducer.d.ts +7 -1
- package/lib/typescript/lib/module/reducer.d.ts.map +1 -1
- package/lib/typescript/lib/module/services/google-consent-mode-mapper.d.ts +71 -0
- package/lib/typescript/lib/module/services/google-consent-mode-mapper.d.ts.map +1 -0
- package/lib/typescript/lib/module/types/google-consent-mode.d.ts +38 -0
- package/lib/typescript/lib/module/types/google-consent-mode.d.ts.map +1 -0
- package/lib/typescript/lib/module/utils/OsanoLogger.d.ts +15 -0
- package/lib/typescript/lib/module/utils/OsanoLogger.d.ts.map +1 -0
- package/lib/typescript/lib/module/utils/Translator.d.ts +1 -1
- package/lib/typescript/lib/module/utils/Translator.d.ts.map +1 -1
- package/lib/typescript/lib/module/utils/index.d.ts +1 -0
- package/lib/typescript/src/ConsentManager.d.ts +23 -7
- package/lib/typescript/src/ConsentManager.d.ts.map +1 -1
- package/lib/typescript/src/ConsentUiBuilder.d.ts +1 -1
- package/lib/typescript/src/ConsentUiBuilder.d.ts.map +1 -1
- package/lib/typescript/src/commands.d.ts.map +1 -1
- package/lib/typescript/src/components/Button.d.ts +1 -1
- package/lib/typescript/src/components/Button.d.ts.map +1 -1
- package/lib/typescript/src/components/Divider.d.ts.map +1 -1
- package/lib/typescript/src/components/ExpansionPanel.d.ts.map +1 -1
- package/lib/typescript/src/components/Link.d.ts.map +1 -1
- package/lib/typescript/src/components/Locale.d.ts.map +1 -1
- package/lib/typescript/src/components/StoragePolicyLink.d.ts.map +1 -1
- package/lib/typescript/src/components/Toggle.d.ts.map +1 -1
- package/lib/typescript/src/context.d.ts +4 -2
- package/lib/typescript/src/context.d.ts.map +1 -1
- package/lib/typescript/src/iab/actions.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/api.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/consent.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/AbstractBase64UrlEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/BooleanEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/DatetimeEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FibonacciIntegerEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FibonacciIntegerRangeEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FixedBitfieldEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerListEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FixedIntegerRangeEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/encoders/FixedStringEncoder.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/v1/constants.d.ts.map +1 -1
- package/lib/typescript/src/iab/gpp/v1/index.d.ts +1 -3
- package/lib/typescript/src/iab/gpp/v1/index.d.ts.map +1 -1
- package/lib/typescript/src/iab/index.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/actions.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/consent.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/constants.d.ts +32 -0
- package/lib/typescript/src/iab/tcf/constants.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/helpers.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/iab-storage-utils.d.ts +24 -0
- package/lib/typescript/src/iab/tcf/iab-storage-utils.d.ts.map +1 -0
- package/lib/typescript/src/iab/tcf/middleware.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/reducer.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/selectors.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/v2.0/formatters.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/v2.0/shared-constants.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/v2.0/tcfcav1-constants.d.ts.map +1 -1
- package/lib/typescript/src/iab/tcf/v2.0/tcfeuv2-constants.d.ts.map +1 -1
- package/lib/typescript/src/iab/usp/api.d.ts +1 -1
- package/lib/typescript/src/iab/usp/api.d.ts.map +1 -1
- package/lib/typescript/src/iab/usp/consent.d.ts.map +1 -1
- package/lib/typescript/src/iab/usp/selectors.d.ts +1 -4
- package/lib/typescript/src/iab/usp/selectors.d.ts.map +1 -1
- package/lib/typescript/src/iab/usp/v1/constants.d.ts.map +1 -1
- package/lib/typescript/src/iab/usp/v1/index.d.ts +1 -1
- package/lib/typescript/src/iab/usp/v1/index.d.ts.map +1 -1
- package/lib/typescript/src/iab/utilities.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +2 -0
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/native/OsanoCmp.d.ts +4 -0
- package/lib/typescript/src/native/OsanoCmp.d.ts.map +1 -1
- package/lib/typescript/src/reducer.d.ts.map +1 -1
- package/lib/typescript/src/selectors.d.ts.map +1 -1
- package/lib/typescript/src/services/consent.d.ts +1 -1
- package/lib/typescript/src/services/consent.d.ts.map +1 -1
- package/lib/typescript/src/services/google-consent-mode-mapper.d.ts +66 -0
- package/lib/typescript/src/services/google-consent-mode-mapper.d.ts.map +1 -0
- package/lib/typescript/src/styles.d.ts.map +1 -1
- package/lib/typescript/src/types/google-consent-mode.d.ts +77 -0
- package/lib/typescript/src/types/google-consent-mode.d.ts.map +1 -0
- package/lib/typescript/src/utils/Color.d.ts.map +1 -1
- package/lib/typescript/src/utils/OsanoLogger.d.ts +15 -0
- package/lib/typescript/src/utils/OsanoLogger.d.ts.map +1 -0
- package/lib/typescript/src/utils/index.d.ts +1 -0
- package/lib/typescript/src/utils/index.d.ts.map +1 -1
- package/package.json +4 -2
- package/src/ConsentManager.ts +93 -25
- package/src/ConsentUiBuilder.tsx +23 -13
- package/src/commands.ts +11 -8
- package/src/components/Button.tsx +17 -17
- package/src/context.ts +6 -3
- package/src/iab/tcf/constants.ts +46 -0
- package/src/iab/tcf/iab-storage-utils.ts +166 -0
- package/src/iab/tcf/middleware.ts +43 -51
- package/src/index.tsx +35 -8
- package/src/locale/af.json +342 -323
- package/src/locale/ar.json +342 -323
- package/src/locale/bg.json +342 -323
- package/src/locale/ca.json +342 -323
- package/src/locale/cs.json +342 -323
- package/src/locale/da.json +342 -323
- package/src/locale/de-at.json +342 -323
- package/src/locale/de.json +342 -323
- package/src/locale/el.json +342 -323
- package/src/locale/en-au.json +342 -323
- package/src/locale/en-ca.json +342 -323
- package/src/locale/en-gb.json +342 -323
- package/src/locale/en.json +342 -323
- package/src/locale/es-mx.json +342 -323
- package/src/locale/es.json +342 -323
- package/src/locale/et.json +342 -323
- package/src/locale/fa.json +342 -323
- package/src/locale/fi.json +342 -323
- package/src/locale/fr-ca.json +342 -323
- package/src/locale/fr.json +342 -323
- package/src/locale/gd.json +342 -323
- package/src/locale/he.json +342 -323
- package/src/locale/hi.json +342 -323
- package/src/locale/hr.json +342 -323
- package/src/locale/hu.json +342 -323
- package/src/locale/hy.json +342 -323
- package/src/locale/id.json +342 -323
- package/src/locale/is.json +342 -323
- package/src/locale/it.json +342 -323
- package/src/locale/ja.json +342 -323
- package/src/locale/kk.json +342 -323
- package/src/locale/ko.json +342 -323
- package/src/locale/lt.json +342 -323
- package/src/locale/lv.json +342 -323
- package/src/locale/mi.json +342 -323
- package/src/locale/ms.json +342 -323
- package/src/locale/nb.json +342 -323
- package/src/locale/nl-be.json +342 -323
- package/src/locale/nl.json +342 -323
- package/src/locale/nn.json +342 -323
- package/src/locale/no.json +342 -323
- package/src/locale/pl.json +342 -323
- package/src/locale/pt-br.json +342 -323
- package/src/locale/pt.json +342 -323
- package/src/locale/ro.json +342 -323
- package/src/locale/ru.json +342 -323
- package/src/locale/sk.json +342 -323
- package/src/locale/sl.json +342 -323
- package/src/locale/sq.json +342 -323
- package/src/locale/sr.json +342 -323
- package/src/locale/sv.json +342 -323
- package/src/locale/th.json +342 -323
- package/src/locale/tl.json +342 -323
- package/src/locale/tr.json +342 -323
- package/src/locale/uk.json +342 -323
- package/src/locale/vi.json +342 -323
- package/src/locale/zh-hk.json +342 -323
- package/src/locale/zh-tw.json +342 -323
- package/src/locale/zh.json +342 -323
- package/src/locale/zu.json +342 -323
- package/src/native/OsanoCmp.ts +29 -0
- package/src/services/consent.ts +9 -8
- package/src/services/google-consent-mode-mapper.ts +122 -0
- package/src/types/google-consent-mode.ts +122 -0
- package/src/types/index.d.ts +4 -2
- package/src/utils/OsanoLogger.ts +53 -0
- package/src/utils/index.ts +2 -0
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import {
|
|
2
|
+
clearStorage,
|
|
3
|
+
clearStorageFromDefault,
|
|
4
|
+
setIntStorageToDefault,
|
|
5
|
+
setStorage,
|
|
6
|
+
setStorageToDefault,
|
|
7
|
+
} from '../../native/OsanoCmp';
|
|
8
|
+
import { osanoLogger } from '../../utils/OsanoLogger';
|
|
9
|
+
import {
|
|
10
|
+
CUSTOM_STORAGE_KEYS,
|
|
11
|
+
DEFAULT_STORAGE_KEYS,
|
|
12
|
+
IABKeys,
|
|
13
|
+
} from './constants';
|
|
14
|
+
|
|
15
|
+
export interface IABConsentData {
|
|
16
|
+
tcString: string;
|
|
17
|
+
cmpId: number;
|
|
18
|
+
cmpVersion: number;
|
|
19
|
+
policyVersion: string;
|
|
20
|
+
publisherCC: string;
|
|
21
|
+
gdprApplies: boolean;
|
|
22
|
+
purposeOneTreatment: boolean;
|
|
23
|
+
useNonStandardStacks: boolean;
|
|
24
|
+
vendorConsentsString: string;
|
|
25
|
+
vendorLegitimateInterestsString: string;
|
|
26
|
+
purposeConsentsString: string;
|
|
27
|
+
purposeLegitimateInterestsString: string;
|
|
28
|
+
specialFeatureOptinsString: string;
|
|
29
|
+
enableAdvertiserConsentMode?: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export const clearAllIABKeys = (): void => {
|
|
33
|
+
osanoLogger.info('🧹 Clearing all IAB consent keys...');
|
|
34
|
+
|
|
35
|
+
Object.values(IABKeys.LEGACY).forEach((key) => {
|
|
36
|
+
clearStorageFromDefault(key);
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
DEFAULT_STORAGE_KEYS.IABTCF.forEach((key) => {
|
|
40
|
+
clearStorageFromDefault(key);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
CUSTOM_STORAGE_KEYS.forEach((key) => {
|
|
44
|
+
clearStorage(key);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
osanoLogger.info(
|
|
48
|
+
'✅ All IAB consent keys cleared from both custom and default storage',
|
|
49
|
+
);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
export const setAllIABKeys = (consentData: IABConsentData): void => {
|
|
53
|
+
const {
|
|
54
|
+
tcString,
|
|
55
|
+
cmpId,
|
|
56
|
+
cmpVersion,
|
|
57
|
+
policyVersion,
|
|
58
|
+
publisherCC,
|
|
59
|
+
gdprApplies,
|
|
60
|
+
purposeOneTreatment,
|
|
61
|
+
useNonStandardStacks,
|
|
62
|
+
vendorConsentsString,
|
|
63
|
+
vendorLegitimateInterestsString,
|
|
64
|
+
purposeConsentsString,
|
|
65
|
+
purposeLegitimateInterestsString,
|
|
66
|
+
specialFeatureOptinsString,
|
|
67
|
+
enableAdvertiserConsentMode,
|
|
68
|
+
} = consentData;
|
|
69
|
+
|
|
70
|
+
osanoLogger.info('💾 Setting IAB consent keys to storage...');
|
|
71
|
+
|
|
72
|
+
const subjectToGDPR = gdprApplies ? '1' : '0';
|
|
73
|
+
|
|
74
|
+
// === Save to Custom Storage ===
|
|
75
|
+
setStorage(IABKeys.IABTCF.CMP_SDK_ID, cmpId.toString());
|
|
76
|
+
setStorage(IABKeys.IABTCF.CMP_SDK_VERSION, cmpVersion.toString());
|
|
77
|
+
setStorage(IABKeys.IABTCF.POLICY_VERSION, policyVersion);
|
|
78
|
+
setStorage(IABKeys.IABTCF.PUBLISHER_CC, publisherCC);
|
|
79
|
+
setStorage(IABKeys.IABTCF.GDPR_APPLIES, subjectToGDPR);
|
|
80
|
+
setStorage(
|
|
81
|
+
IABKeys.IABTCF.PURPOSE_ONE_TREATMENT,
|
|
82
|
+
purposeOneTreatment ? '1' : '0',
|
|
83
|
+
);
|
|
84
|
+
setStorage(
|
|
85
|
+
IABKeys.IABTCF.USE_NON_STANDARD_TEXTS,
|
|
86
|
+
useNonStandardStacks ? '1' : '0',
|
|
87
|
+
);
|
|
88
|
+
setStorage(IABKeys.IABTCF.VENDOR_CONSENTS, vendorConsentsString);
|
|
89
|
+
setStorage(
|
|
90
|
+
IABKeys.IABTCF.VENDOR_LEGITIMATE_INTERESTS,
|
|
91
|
+
vendorLegitimateInterestsString,
|
|
92
|
+
);
|
|
93
|
+
setStorage(IABKeys.IABTCF.PURPOSE_CONSENTS, purposeConsentsString);
|
|
94
|
+
setStorage(
|
|
95
|
+
IABKeys.IABTCF.PURPOSE_LEGITIMATE_INTERESTS,
|
|
96
|
+
purposeLegitimateInterestsString,
|
|
97
|
+
);
|
|
98
|
+
setStorage(
|
|
99
|
+
IABKeys.IABTCF.SPECIAL_FEATURES_OPT_INS,
|
|
100
|
+
specialFeatureOptinsString,
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
// === Save to Default Storage for AdMob Compatibility ===
|
|
104
|
+
|
|
105
|
+
setStorageToDefault(IABKeys.LEGACY.CMP_PRESENT, 'true');
|
|
106
|
+
setStorageToDefault(IABKeys.LEGACY.SUBJECT_TO_GDPR, subjectToGDPR);
|
|
107
|
+
setStorageToDefault(IABKeys.LEGACY.CONSENT_STRING, tcString);
|
|
108
|
+
setStorageToDefault(
|
|
109
|
+
IABKeys.LEGACY.PARSED_PURPOSE_CONSENTS,
|
|
110
|
+
purposeConsentsString,
|
|
111
|
+
);
|
|
112
|
+
setStorageToDefault(
|
|
113
|
+
IABKeys.LEGACY.PARSED_VENDOR_CONSENTS,
|
|
114
|
+
vendorConsentsString,
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
setIntStorageToDefault(IABKeys.IABTCF.GDPR_APPLIES, gdprApplies ? 1 : 0);
|
|
118
|
+
setStorageToDefault(IABKeys.IABTCF.TC_STRING, tcString);
|
|
119
|
+
setStorageToDefault(IABKeys.IABTCF.PURPOSE_CONSENTS, purposeConsentsString);
|
|
120
|
+
setStorageToDefault(IABKeys.IABTCF.VENDOR_CONSENTS, vendorConsentsString);
|
|
121
|
+
setStorageToDefault(IABKeys.IABTCF.ADDTL_CONSENT, '');
|
|
122
|
+
|
|
123
|
+
// Handle Google Consent Mode integration
|
|
124
|
+
if (enableAdvertiserConsentMode !== undefined) {
|
|
125
|
+
setIntStorageToDefault(
|
|
126
|
+
IABKeys.IABTCF.ENABLE_ADVERTISER_CONSENT_MODE,
|
|
127
|
+
enableAdvertiserConsentMode ? 1 : 0,
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
const status = enableAdvertiserConsentMode ? 'enabled' : 'disabled';
|
|
131
|
+
const reason = enableAdvertiserConsentMode
|
|
132
|
+
? '(both Google Consent Mode and IAB TCF are applicable)'
|
|
133
|
+
: '(Google Consent Mode or IAB TCF not applicable)';
|
|
134
|
+
|
|
135
|
+
osanoLogger.info(
|
|
136
|
+
`🔗 Google TCF integration ${status}: ${IABKeys.IABTCF.ENABLE_ADVERTISER_CONSENT_MODE} = ${enableAdvertiserConsentMode ? 1 : 0} ${reason}`,
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
osanoLogger.info(
|
|
141
|
+
'✅ IAB consent keys saved to both custom and default storage for AdMob compatibility',
|
|
142
|
+
);
|
|
143
|
+
osanoLogger.debug(
|
|
144
|
+
`📊 Updated IAB keys: CMP=true, SubjectToGDPR=${subjectToGDPR}, PurposeConsents=${purposeConsentsString.length} chars, VendorConsents=${vendorConsentsString.length} chars`,
|
|
145
|
+
);
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
export const setCustomIABKey = (key: string, value: string): void => {
|
|
149
|
+
setStorage(key, value);
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
export const setDefaultIABKey = (key: string, value: string): void => {
|
|
153
|
+
setStorageToDefault(key, value);
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export const setDefaultIABKeyAsInt = (key: string, value: number): void => {
|
|
157
|
+
setIntStorageToDefault(key, value);
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export const clearCustomIABKey = (key: string): void => {
|
|
161
|
+
clearStorage(key);
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
export const clearDefaultIABKey = (key: string): void => {
|
|
165
|
+
clearStorageFromDefault(key);
|
|
166
|
+
};
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
// @ts-nocheck
|
|
2
2
|
import { CLEAR_CONSENT, CLOSE, RELOAD, SET_CONFIG } from '../../actions';
|
|
3
|
-
import
|
|
3
|
+
import { clearStorage, getStorage, setStorage } from '../../native/OsanoCmp';
|
|
4
4
|
import type { OsanoAction, OsanoState } from '../../types/store';
|
|
5
|
+
import { osanoLogger } from '../../utils/OsanoLogger';
|
|
6
|
+
import { SET_CONSENT_DATA, setConsentData } from '../actions';
|
|
5
7
|
import {
|
|
6
8
|
SET_ALL_PURPOSE_CONSENT,
|
|
7
9
|
SET_ALL_SPECIAL_FEATURE_CONSENT,
|
|
8
10
|
SET_ALL_VENDOR_CONSENT,
|
|
9
11
|
setConsent,
|
|
10
12
|
} from './actions';
|
|
11
|
-
import {
|
|
12
|
-
import { clearStorage, getStorage, setStorage } from '../../native/OsanoCmp';
|
|
13
|
-
import { getConsentString, getPurposeIds } from './selectors';
|
|
13
|
+
import { makeFormatConsentString, makeParseConsentString } from './consent';
|
|
14
14
|
import {
|
|
15
15
|
idRecordToBinaryString,
|
|
16
16
|
updatePurposeOptOuts,
|
|
17
17
|
updateSpecialFeatureOptIns,
|
|
18
18
|
updateVendorOptOuts,
|
|
19
19
|
} from './helpers';
|
|
20
|
-
import {
|
|
20
|
+
import { clearAllIABKeys, setAllIABKeys } from './iab-storage-utils';
|
|
21
|
+
import { getConsentString, getPurposeIds } from './selectors';
|
|
22
|
+
import type { IabMiddlewareFactory, Tcf_v2 } from './types';
|
|
21
23
|
|
|
22
|
-
import type { ConsentManager } from '../../ConsentManager';
|
|
23
|
-
import type { IabInitOptions } from './types';
|
|
24
|
-
import type { IabState } from '../types';
|
|
25
24
|
import { Platform } from 'react-native';
|
|
25
|
+
import type { ConsentManager } from '../../ConsentManager';
|
|
26
26
|
import type { Store } from '../../hooks/useThunkReducer';
|
|
27
|
+
import type { IabState } from '../types';
|
|
28
|
+
import type { IabInitOptions } from './types';
|
|
27
29
|
|
|
28
30
|
export const makeMiddleware: IabMiddlewareFactory = (
|
|
29
31
|
initOptions: IabInitOptions,
|
|
@@ -91,6 +93,8 @@ export const makeMiddleware: IabMiddlewareFactory = (
|
|
|
91
93
|
case 'ios':
|
|
92
94
|
case 'android':
|
|
93
95
|
clearStorage(`${gppSection}_${configId}`);
|
|
96
|
+
|
|
97
|
+
clearAllIABKeys();
|
|
94
98
|
break;
|
|
95
99
|
default:
|
|
96
100
|
try {
|
|
@@ -160,52 +164,40 @@ export const makeMiddleware: IabMiddlewareFactory = (
|
|
|
160
164
|
// no change
|
|
161
165
|
break;
|
|
162
166
|
}
|
|
163
|
-
|
|
167
|
+
osanoLogger.info(`Setting new consent string -> ${value}`);
|
|
164
168
|
const consent = parseConsentString(value);
|
|
169
|
+
|
|
165
170
|
setStorage(storageKey, value);
|
|
166
|
-
setStorage('IABTCF_CmpSdkID', cmpId.toString());
|
|
167
|
-
setStorage('IABTCF_CmpSdkVersion', cmpVersion.toString());
|
|
168
|
-
setStorage('IABTCF_PolicyVersion', version);
|
|
169
|
-
setStorage('IABTCF_PublisherCC', consent.publisherCC);
|
|
170
|
-
setStorage('IABTCF_gdprApplies', consent.gdprApplies ? '1' : '0');
|
|
171
|
-
setStorage(
|
|
172
|
-
'IABTCF_PurposeOneTreatment',
|
|
173
|
-
consent.purposeOneTreatment ? '1' : '0',
|
|
174
|
-
);
|
|
175
|
-
setStorage(
|
|
176
|
-
'IABTCF_UseNonStandardTexts',
|
|
177
|
-
consent.useNonStandardStacks ? '1' : '0',
|
|
178
|
-
);
|
|
179
171
|
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
idRecordToBinaryString(
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
172
|
+
const consentData = {
|
|
173
|
+
tcString: value,
|
|
174
|
+
cmpId,
|
|
175
|
+
cmpVersion,
|
|
176
|
+
policyVersion: version,
|
|
177
|
+
publisherCC: consent.publisherCC,
|
|
178
|
+
gdprApplies: consent.gdprApplies,
|
|
179
|
+
purposeOneTreatment: consent.purposeOneTreatment,
|
|
180
|
+
useNonStandardStacks: consent.useNonStandardStacks,
|
|
181
|
+
vendorConsentsString: idRecordToBinaryString(
|
|
182
|
+
consent.vendor.consents,
|
|
183
|
+
),
|
|
184
|
+
vendorLegitimateInterestsString: idRecordToBinaryString(
|
|
185
|
+
consent.vendor.legitimateInterests,
|
|
186
|
+
),
|
|
187
|
+
purposeConsentsString: idRecordToBinaryString(
|
|
188
|
+
consent.purpose.consents,
|
|
189
|
+
),
|
|
190
|
+
purposeLegitimateInterestsString: idRecordToBinaryString(
|
|
191
|
+
consent.purpose.legitimateInterests,
|
|
192
|
+
),
|
|
193
|
+
specialFeatureOptinsString: idRecordToBinaryString(
|
|
194
|
+
consent.specialFeatureOptins,
|
|
195
|
+
),
|
|
196
|
+
enableAdvertiserConsentMode:
|
|
197
|
+
config?.googleConsent && config?.tcfIsApplicable,
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
setAllIABKeys(consentData);
|
|
209
201
|
}
|
|
210
202
|
}
|
|
211
203
|
}
|
package/src/index.tsx
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import type { OsanoAction, OsanoState } from './types/store';
|
|
2
|
-
import { OsanoCategories, init, reducer } from './reducer';
|
|
3
|
-
import { Platform, UIManager } from 'react-native';
|
|
4
1
|
import React, { memo, useCallback, useEffect, useMemo, useRef } from 'react';
|
|
2
|
+
import { Platform, UIManager } from 'react-native';
|
|
5
3
|
import {
|
|
6
4
|
CLEAR_CONSENT,
|
|
7
5
|
reload,
|
|
@@ -10,20 +8,30 @@ import {
|
|
|
10
8
|
showDialog,
|
|
11
9
|
showDrawer,
|
|
12
10
|
} from './actions';
|
|
11
|
+
import { OsanoCategories, init, reducer } from './reducer';
|
|
12
|
+
import type { OsanoAction, OsanoState } from './types/store';
|
|
13
13
|
|
|
14
|
-
import { ConsentCategory } from './constants';
|
|
15
14
|
import { ConsentManager } from './ConsentManager';
|
|
16
15
|
import { ConsentUiBuilder } from './ConsentUiBuilder';
|
|
17
|
-
import
|
|
16
|
+
import { ConsentCategory } from './constants';
|
|
18
17
|
import { OsanoPublicContext } from './context';
|
|
18
|
+
import { usePrevious } from './hooks/usePrevious';
|
|
19
|
+
import useThunkReducer, { type Store } from './hooks/useThunkReducer';
|
|
19
20
|
import { addIabReducers } from './iab';
|
|
21
|
+
import type { IabFramework, IabState } from './iab/types';
|
|
20
22
|
import { getConsent } from './selectors';
|
|
21
23
|
import { recordConsent } from './services/consent';
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import { usePrevious } from './hooks/usePrevious';
|
|
24
|
+
import type { OsanoProps } from './types';
|
|
25
|
+
import { osanoLogger as OsanoLogger } from './utils/OsanoLogger';
|
|
25
26
|
|
|
26
27
|
export { OsanoPublicContext as OsanoContext } from './context';
|
|
28
|
+
export { GoogleConsentModeMapper } from './services/google-consent-mode-mapper';
|
|
29
|
+
export type {
|
|
30
|
+
GoogleConsentMap,
|
|
31
|
+
GoogleConsentModeCallback,
|
|
32
|
+
GoogleConsentParameter,
|
|
33
|
+
GoogleConsentStatus,
|
|
34
|
+
} from './types/google-consent-mode';
|
|
27
35
|
|
|
28
36
|
if (Platform.OS === 'android') {
|
|
29
37
|
if (UIManager.setLayoutAnimationEnabledExperimental) {
|
|
@@ -44,14 +52,20 @@ export const Osano: React.FunctionComponent<
|
|
|
44
52
|
onConfigLoadSuccess,
|
|
45
53
|
onLangLoadFailure,
|
|
46
54
|
onLangLoadSuccess,
|
|
55
|
+
onGoogleConsentUpdate,
|
|
47
56
|
overrides,
|
|
48
57
|
extUsrData,
|
|
58
|
+
setLoggingEnabled = true,
|
|
49
59
|
} = props;
|
|
50
60
|
const { flavor, iabEnabled } = overrides || {};
|
|
51
61
|
const consentManager = useRef<ConsentManager>(
|
|
52
62
|
new ConsentManager(overrides, extUsrData),
|
|
53
63
|
);
|
|
54
64
|
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
OsanoLogger.setEnabled(setLoggingEnabled);
|
|
67
|
+
}, [setLoggingEnabled]);
|
|
68
|
+
|
|
55
69
|
const [_state, store] = useThunkReducer<OsanoState, OsanoAction>(
|
|
56
70
|
reducer,
|
|
57
71
|
{ configId, customerId },
|
|
@@ -91,6 +105,9 @@ export const Osano: React.FunctionComponent<
|
|
|
91
105
|
|
|
92
106
|
const handleClearConsent = useCallback(() => {
|
|
93
107
|
dispatch({ type: CLEAR_CONSENT });
|
|
108
|
+
consentManager.current.triggerGoogleConsentUpdate([
|
|
109
|
+
ConsentCategory.ESSENTIAL,
|
|
110
|
+
]);
|
|
94
111
|
}, []);
|
|
95
112
|
|
|
96
113
|
const retryWithBackoff = async (
|
|
@@ -177,6 +194,15 @@ export const Osano: React.FunctionComponent<
|
|
|
177
194
|
consentManager.current.config.type = flavor;
|
|
178
195
|
}, [flavor]);
|
|
179
196
|
|
|
197
|
+
// Set up Google Consent Mode callback if provided
|
|
198
|
+
useEffect(() => {
|
|
199
|
+
if (onGoogleConsentUpdate) {
|
|
200
|
+
consentManager.current.setGoogleConsentModeCallback(
|
|
201
|
+
onGoogleConsentUpdate,
|
|
202
|
+
);
|
|
203
|
+
}
|
|
204
|
+
}, [onGoogleConsentUpdate]);
|
|
205
|
+
|
|
180
206
|
const iabLoaded = useRef(false);
|
|
181
207
|
const iabChanged = usePrevious(iabEnabled) !== iabEnabled;
|
|
182
208
|
useEffect(() => {
|
|
@@ -235,6 +261,7 @@ export const Osano: React.FunctionComponent<
|
|
|
235
261
|
prev.hideUI === next.hideUI &&
|
|
236
262
|
prev.hideDisclosures === next.hideDisclosures &&
|
|
237
263
|
prev.children === next.children &&
|
|
264
|
+
prev.setLoggingEnabled === next.setLoggingEnabled &&
|
|
238
265
|
flavor === nextFlavor &&
|
|
239
266
|
iabEnabled === nextIabEnabled
|
|
240
267
|
);
|