UNPKG

@sourcepoint/react-native-cmp

Version:
70 lines (69 loc) 2.3 kB
"use strict"; import ReactNativeCmp, { SPMessageLanguage } from "./NativeReactNativeCmp.js"; export * from "./NativeReactNativeCmp.js"; const defaultBuildOptions = { language: SPMessageLanguage.ENGLISH, messageTimeoutInSeconds: 30 }; export default class SPConsentManager { /** intended to be used by the SDK only */ internalOnAction = ReactNativeCmp.internalOnAction; /** intended to be used by the SDK only */ internalOnError = ReactNativeCmp.internalOnError; onSPUIReady = ReactNativeCmp.onSPUIReady; onSPUIFinished = ReactNativeCmp.onSPUIFinished; onFinished = ReactNativeCmp.onFinished; onMessageInactivityTimeout = ReactNativeCmp.onMessageInactivityTimeout; onAction(handler) { ReactNativeCmp.internalOnAction(stringifiedAction => { handler(JSON.parse(stringifiedAction)); }); } onError(handler) { ReactNativeCmp.internalOnError(stringifiedError => { handler(JSON.parse(stringifiedError)); }); } getConstants() { throw new Error('Method not implemented.'); } build(accountId, propertyId, propertyName, campaigns, options = defaultBuildOptions) { ReactNativeCmp.build(accountId, propertyId, propertyName, campaigns, options); } getUserData() { return ReactNativeCmp.getUserData(); } loadMessage(params = { authId: undefined }) { ReactNativeCmp.loadMessage(params); } clearLocalData() { ReactNativeCmp.clearLocalData(); } loadGDPRPrivacyManager(pmId) { ReactNativeCmp.loadGDPRPrivacyManager(pmId); } loadUSNatPrivacyManager(pmId) { ReactNativeCmp.loadUSNatPrivacyManager(pmId); } loadGlobalCmpPrivacyManager(pmId) { ReactNativeCmp.loadGlobalCmpPrivacyManager(pmId); } loadPreferenceCenter(id) { ReactNativeCmp.loadPreferenceCenter(id); } dismissMessage() { ReactNativeCmp.dismissMessage(); } postCustomConsentGDPR(vendors, categories, legIntCategories, callback) { ReactNativeCmp.postCustomConsentGDPR(vendors, categories, legIntCategories, callback); } postDeleteCustomConsentGDPR(vendors, categories, legIntCategories, callback) { ReactNativeCmp.postDeleteCustomConsentGDPR(vendors, categories, legIntCategories, callback); } rejectAll(campaignType) { ReactNativeCmp.rejectAll(campaignType); } } //# sourceMappingURL=index.js.map