@@ -25,71 +25,87 @@ export const Usercentrics = {
2525 return RNUsercentricsModule . isReady ( ) ;
2626 } ,
2727
28- showCMP : ( options : UsercentricsUIOptions ) : Promise < UsercentricsConsentUserResponse > => {
28+ showCMP : async ( options : UsercentricsUIOptions ) : Promise < UsercentricsConsentUserResponse > => {
29+ await RNUsercentricsModule . isReady ( ) ;
2930 return RNUsercentricsModule . showCMP ( options ) ;
3031 } ,
3132
32- restoreUserSession : ( controllerId : string ) : Promise < UsercentricsReadyStatus > => {
33+ restoreUserSession : async ( controllerId : string ) : Promise < UsercentricsReadyStatus > => {
34+ await RNUsercentricsModule . isReady ( ) ;
3335 return RNUsercentricsModule . restoreUserSession ( controllerId ) ;
3436 } ,
3537
36- getControllerId : ( ) : Promise < string > => {
38+ getControllerId : async ( ) : Promise < string > => {
39+ await RNUsercentricsModule . isReady ( ) ;
3740 return RNUsercentricsModule . getControllerId ( ) ;
3841 } ,
3942
40- getTCFString : ( ) : Promise < string > => {
43+ getTCFString : async ( ) : Promise < string > => {
44+ await RNUsercentricsModule . isReady ( ) ;
4145 return RNUsercentricsModule . getTCFString ( ) ;
4246 } ,
4347
44- getConsents : ( ) : Promise < [ UsercentricsServiceConsent ] > => {
48+ getConsents : async ( ) : Promise < [ UsercentricsServiceConsent ] > => {
49+ await RNUsercentricsModule . isReady ( ) ;
4550 return RNUsercentricsModule . getConsents ( ) ;
4651 } ,
4752
48- getCMPData : ( ) : Promise < UsercentricsCMPData > => {
53+ getCMPData : async ( ) : Promise < UsercentricsCMPData > => {
54+ await RNUsercentricsModule . isReady ( ) ;
4955 return RNUsercentricsModule . getCMPData ( ) ;
5056 } ,
5157
5258 getUserSessionData : ( ) : Promise < string > => {
5359 return RNUsercentricsModule . getUserSessionData ( ) ;
5460 } ,
5561
56- getCCPAData : ( ) : Promise < CCPAData > => {
62+ getCCPAData : async ( ) : Promise < CCPAData > => {
63+ await RNUsercentricsModule . isReady ( ) ;
5764 return RNUsercentricsModule . getUSPData ( ) ;
5865 } ,
5966
60- getTCFData : ( ) : Promise < TCFData > => {
67+ getTCFData : async ( ) : Promise < TCFData > => {
68+ await RNUsercentricsModule . isReady ( ) ;
6169 return RNUsercentricsModule . getTCFData ( ) ;
6270 } ,
6371
64- changeLanguage : ( language : string ) : Promise < void > => {
72+ changeLanguage : async ( language : string ) : Promise < void > => {
73+ await RNUsercentricsModule . isReady ( ) ;
6574 return RNUsercentricsModule . changeLanguage ( language ) ;
6675 } ,
6776
68- acceptAll : ( consentType : UsercentricsConsentType ) : Promise < [ UsercentricsServiceConsent ] > => {
77+ acceptAll : async ( consentType : UsercentricsConsentType ) : Promise < [ UsercentricsServiceConsent ] > => {
78+ await RNUsercentricsModule . isReady ( ) ;
6979 return RNUsercentricsModule . acceptAll ( consentType ) ;
7080 } ,
7181
72- acceptAllForTCF : ( fromLayer : TCFDecisionUILayer , consentType : UsercentricsConsentType ) : Promise < [ UsercentricsServiceConsent ] > => {
82+ acceptAllForTCF : async ( fromLayer : TCFDecisionUILayer , consentType : UsercentricsConsentType ) : Promise < [ UsercentricsServiceConsent ] > => {
83+ await RNUsercentricsModule . isReady ( ) ;
7384 return RNUsercentricsModule . acceptAllForTCF ( fromLayer , consentType ) ;
7485 } ,
7586
76- denyAll : ( consentType : UsercentricsConsentType ) : Promise < [ UsercentricsServiceConsent ] > => {
87+ denyAll : async ( consentType : UsercentricsConsentType ) : Promise < [ UsercentricsServiceConsent ] > => {
88+ await RNUsercentricsModule . isReady ( ) ;
7789 return RNUsercentricsModule . denyAll ( consentType ) ;
7890 } ,
7991
80- denyAllForTCF : ( fromLayer : TCFDecisionUILayer , consentType : UsercentricsConsentType ) : Promise < [ UsercentricsServiceConsent ] > => {
92+ denyAllForTCF : async ( fromLayer : TCFDecisionUILayer , consentType : UsercentricsConsentType ) : Promise < [ UsercentricsServiceConsent ] > => {
93+ await RNUsercentricsModule . isReady ( ) ;
8194 return RNUsercentricsModule . denyAllForTCF ( fromLayer , consentType ) ;
8295 } ,
8396
84- saveDecisions : ( decisions : [ UserDecision ] , consentType : UsercentricsConsentType ) : Promise < [ UsercentricsServiceConsent ] > => {
97+ saveDecisions : async ( decisions : [ UserDecision ] , consentType : UsercentricsConsentType ) : Promise < [ UsercentricsServiceConsent ] > => {
98+ await RNUsercentricsModule . isReady ( ) ;
8599 return RNUsercentricsModule . saveDecisions ( decisions , consentType ) ;
86100 } ,
87101
88- saveDecisionsForTCF : ( tcfDecisions : TCFUserDecisions , fromLayer : TCFDecisionUILayer , decisions : [ UserDecision ] , consentType : UsercentricsConsentType ) : Promise < [ UsercentricsServiceConsent ] > => {
102+ saveDecisionsForTCF : async ( tcfDecisions : TCFUserDecisions , fromLayer : TCFDecisionUILayer , decisions : [ UserDecision ] , consentType : UsercentricsConsentType ) : Promise < [ UsercentricsServiceConsent ] > => {
103+ await RNUsercentricsModule . isReady ( ) ;
89104 return RNUsercentricsModule . saveDecisionsForTCF ( tcfDecisions , fromLayer , decisions , consentType ) ;
90105 } ,
91106
92- saveOptOutForCCPA : ( isOptedOut : boolean , consentType : UsercentricsConsentType ) : Promise < [ UsercentricsServiceConsent ] > => {
107+ saveOptOutForCCPA : async ( isOptedOut : boolean , consentType : UsercentricsConsentType ) : Promise < [ UsercentricsServiceConsent ] > => {
108+ await RNUsercentricsModule . isReady ( ) ;
93109 return RNUsercentricsModule . saveOptOutForCCPA ( isOptedOut , consentType ) ;
94110 } ,
95111
0 commit comments