MCPcopy Create free account
hub / github.com/NativeScript/firebase / setConsent

Method setConsent

packages/firebase-analytics/index.ios.ts:86–119  ·  view source on GitHub ↗
(consentSettings: Map<ConsentType, ConsentStatus>)

Source from the content-addressed store, hash-verified

84 }
85
86 setConsent(consentSettings: Map<ConsentType, ConsentStatus>): void {
87 const dictionary = {};
88 consentSettings.forEach((value, key) => {
89 let nativeKey;
90 let nativeValue;
91 switch (key) {
92 case ConsentType.Ad_Storage:
93 nativeKey = FIRConsentTypeAdStorage;
94 break;
95 case ConsentType.Analytics_Storage:
96 nativeKey = FIRConsentTypeAnalyticsStorage;
97 break;
98 case ConsentType.Ad_User_Data:
99 nativeKey = FIRConsentTypeAdUserData;
100 break;
101 case ConsentType.Ad_Personalization:
102 nativeKey = FIRConsentTypeAdPersonalization;
103 break;
104 }
105
106 switch (value) {
107 case ConsentStatus.Denied:
108 nativeValue = FIRConsentStatusDenied;
109 break;
110 case ConsentStatus.Granted:
111 nativeValue = FIRConsentStatusGranted;
112 break;
113 }
114 if (nativeKey && nativeValue) {
115 dictionary[nativeKey] = nativeValue;
116 }
117 });
118 FIRAnalytics.setConsent(dictionary as any);
119 }
120}

Callers

nothing calls this directly

Calls 2

forEachMethod · 0.65
setConsentMethod · 0.65

Tested by

no test coverage detected