UNPKG

@adobe/react-native-aepedgeconsent

Version:

Adobe Experience Platform Consent Collection extension for AEP Mobile SDK. Written and maintained by Adobe.

43 lines (42 loc) 1.88 kB
"use strict"; /* Copyright 2022 Adobe. All rights reserved. This file is licensed to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ Object.defineProperty(exports, "__esModule", { value: true }); const react_native_1 = require("react-native"); const RCTAEPEdgeConsent = react_native_1.NativeModules.AEPEdgeConsent; const Consent = { /** * Returns the version of the Consent extension * @return {string} Promise resolves with the extension version */ extensionVersion() { return Promise.resolve(RCTAEPEdgeConsent.extensionVersion()); }, /** * Merges the existing consents with the given consents. Duplicate keys will take the value of those passed in the API * Input example: {"consents": {"collect": {"val": "y"}}} * @param {Record<string, any>} consents to be merged with the existing consents */ update(consents) { RCTAEPEdgeConsent.update(consents); }, /** * Retrieves the current consent preferences stored in the Consent extension * Output example: {"consents": {"collect": {"val": "y"}}} * @return {{Promise<Record<string, any>>}} Promise resolved with the current consent preferences or rejected * if an unexpected error occurs or the request timed out */ getConsents() { return RCTAEPEdgeConsent.getConsents(); } }; exports.default = Consent; //# sourceMappingURL=Consent.js.map