@adobe/react-native-aepedgeconsent
TypeScript icon, indicating that this package has built-in type declarations

7.0.0 • Public • Published

React Native Consent for Edge Network Extension

npm version npm downloads

@adobe/react-native-aepedgeconsent is a wrapper for the iOS and Android Consent for Edge Network extension to allow for integration with React Native applications.

Prerequisites

The Consent for Edge Network extension has the following peer dependency, which must be installed prior to installing the Consent extension:

Installation

See Requirements and Installation instructions on the main page.

Install the @adobe/react-native-aepedgeconsent package:

NPM:

npm install @adobe/react-native-aepedgeconsent

Yarn:

yarn add @adobe/react-native-aepedgeconsent

Usage

Initializing with SDK:

To initialize the SDK, use the following methods:

Refer to the root Readme for more information about the SDK setup.

Importing the extension

In your React Native application, import the Consent extension as follows:

import {Consent} from "@adobe/react-native-aepedgeconsent";

API reference

extensionVersion

Returns the version of the Consent extension

Syntax

extensionVersion(): Promise<string>

Example

Consent.extensionVersion().then(version => console.log("Consent.extensionVersion: " + version));

getConsents

Retrieves the current consent preferences stored in the Consent extension and resolves the promise with the current consent preferences or rejects it if an unexpected error occurs or the request timed out. Output example: {"consents": {"collect": {"val": "y"}}}

Syntax

getConsents(): Promise<Record<string, any>>

Example

Consent.getConsents().then(consents => {
  console.log("AEPConsent.getConsents returned current consent preferences:  " + JSON.stringify(consents));
}).catch((error) => {
  console.warn("AEPConsent.getConsents returned error: ", error.message);
});

update

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"}}}

Syntax

update(consents: Record<string, any>) 

Example

var consents: {[keys: string]: any} = {"consents" : {"collect" : {"val": "y"}}};
Consent.update(consents);

Package Sidebar

Install

npm i @adobe/react-native-aepedgeconsent

Weekly Downloads

7,262

Version

7.0.0

License

Apache-2.0

Unpacked Size

49.8 kB

Total Files

22

Last publish

Collaborators

  • marbec
  • tripod
  • garthdb
  • lazd
  • adobe-admin
  • patrickfulton
  • trieloff
  • shazron
  • krisnye
  • dcpfsdk
  • natebaldwin
  • devongovett
  • aspro83
  • symanovi
  • dpfister
  • stefan-guggisberg
  • rofe
  • kptdobe
  • adobehalls
  • fullcolorcoder
  • djaeggi
  • dylandepass
  • mhaack
  • amol-anand
  • stopp-adobe
  • doten
  • duh_schmidt
  • asthabh23
  • zdahbi
  • tuicu