tenerity-cookie-popup-mobile-sdk
v1.5.0
Published
gce-mobile-app-cookie-popup-react-native is a library that pulls in a configurable OneTrust template
Downloads
26
Readme
gce-mobile-app-cookie-popup-react-native is a library that pulls in a configurable OneTrust template
Pull in with :
npm install tenerity-cookie-popup-mobile-sdk
yarn add tenerity-cookie-popup-mobile-sdk
To use this library:
import { CookiePopup, TemplateProvider } from "tenerity-cookie-popup-mobile-sdk";
You must wrap your App.js in the TemplateContext for the context to work:
<TemplateProvider></TemplateProvider>
Initialize with font (accepts two arguments fontFamily, fontWeight), applicationId, sdkVerasion, language and the callback after user has accepted Cookies:
const font = {fontFamily: "RN House Sans Light", fontWeight: "400"}
<CookiePopup
font={font}
applicationID="5df24d64-a26d-47a4-a661-b7aa65648909-test"
sdkVersion="6.14.0"
language="en-gb"
website="idprotect.de"
onAcceptCookiesCB={(cookies) => console.log(cookies)}
/>
You can post to onetrust the username on login, in order to save consets:
OneTrust.getInstance().postConsents("[email protected]");
To deplay just the Cookie Preferences page (There is no need to pass the inialization parameters), but you can still pass the onAcceptCookiesCB if you wish to retrieve that data. Here is an example of how you might open and close the popup.
{showConsents && (
<CookiePopup
presentModal={true}
onAcceptCookiesCB={(cookies) => { setShowConsents(false); console.log(cookies);}}
/>
)}
onAcceptCookiesCB is a callback that returns an array of cookie IDs that have been accepted by the user.
OPTIONAL: Font can be passed through and will apply to all text within the library. It accepts a dictionary that can contain fontFamily and fontWeight.
OPTIONAL: Website can be passed through and will stop all cookie popups and pass consents to that url using apps consentID. URL MUST BE PASSED without https or www to allow for all subdomains: idprotect.de
SDK version is the SDK version used by onetrust on the UI
language is the lanugage wanted to be displayed from the onetrust categorization section
applicationID is the applicationID used by onetrust
This library should meet double AA accessibility standards if it does not please contact mobile development team.
To Work on this library:
Add the node module to a project of your choice and work directly in the node module after installation and publish to repo and npm from there
Check confluence for details on npm login