11import * as React from 'react' ;
22import { View , ScrollView , SafeAreaView , Button , Text } from 'react-native' ;
33
4- import { SPConsentManager } from 'react-native-sourcepoint -cmp' ;
4+ import { SPConsentManager } from '@sourcepoint/ react-native-cmp' ;
55
66const config = {
77 accountId : 22 ,
@@ -14,7 +14,7 @@ const config = {
1414const consentManager = new SPConsentManager (
1515 config . accountId ,
1616 config . propertyId ,
17- config . propertyName ,
17+ config . propertyName
1818) ;
1919
2020export default function App ( ) {
@@ -23,33 +23,43 @@ export default function App() {
2323 React . useEffect ( ( ) => {
2424 consentManager . onFinished ( ( ) => {
2525 consentManager . getUserData ( ) . then ( setUserData ) ;
26- } )
26+ } ) ;
2727 consentManager . loadMessage ( ) ;
2828 consentManager . getUserData ( ) . then ( setUserData ) ;
2929 } , [ ] ) ;
3030
3131 return (
3232 < SafeAreaView >
3333 < View >
34- < Button title = 'Load Messages' onPress = { ( ) => {
35- consentManager . loadMessage ( ) ;
36- } } />
37- < Button title = 'Load GDPR PM' onPress = { ( ) => {
38- consentManager . loadGDPRPrivacyManager ( config . gdprPMId ) ;
39- } } />
40- < Button title = 'Load CCPA PM' onPress = { ( ) => {
41- consentManager . loadCCPAPrivacyManager ( config . ccpaPMId ) ;
42- } } />
43- < Button title = 'Clear All' onPress = { ( ) => {
44- consentManager . clearLocalData ( )
45- consentManager . getUserData ( ) . then ( setUserData )
46- } } />
34+ < Button
35+ title = "Load Messages"
36+ onPress = { ( ) => {
37+ consentManager . loadMessage ( ) ;
38+ } }
39+ />
40+ < Button
41+ title = "Load GDPR PM"
42+ onPress = { ( ) => {
43+ consentManager . loadGDPRPrivacyManager ( config . gdprPMId ) ;
44+ } }
45+ />
46+ < Button
47+ title = "Load CCPA PM"
48+ onPress = { ( ) => {
49+ consentManager . loadCCPAPrivacyManager ( config . ccpaPMId ) ;
50+ } }
51+ />
52+ < Button
53+ title = "Clear All"
54+ onPress = { ( ) => {
55+ consentManager . clearLocalData ( ) ;
56+ consentManager . getUserData ( ) . then ( setUserData ) ;
57+ } }
58+ />
4759 </ View >
4860 < ScrollView >
4961 < ScrollView horizontal = { true } >
50- < Text >
51- { JSON . stringify ( userData , undefined , ' ' ) }
52- </ Text >
62+ < Text > { JSON . stringify ( userData , undefined , ' ' ) } </ Text >
5363 </ ScrollView >
5464 </ ScrollView >
5565 </ SafeAreaView >
0 commit comments