Multiple consent calls cannot be sent within one function:
if (isPlatform(["web", "android", "ios"])) {
const consent = await Preferences.get({ key: 'cookieConsent' });
await FirebaseAnalytics.setConsent({
type: ConsentType.AdPersonalization,
status: consent.value === 'authorized' ? ConsentStatus.Granted : ConsentStatus.Denied
});
await FirebaseAnalytics.setConsent({
type: ConsentType.PersonalizationStorage,
status: consent.value === 'authorized' ? ConsentStatus.Granted : ConsentStatus.Denied
});
await FirebaseAnalytics.setConsent({
type: ConsentType.AdUserData,
status: consent.value === 'authorized' ? ConsentStatus.Granted : ConsentStatus.Denied
});
await FirebaseAnalytics.setConsent({
type: ConsentType.AdStorage,
status: consent.value === 'authorized' ? ConsentStatus.Granted : ConsentStatus.Denied
});
await FirebaseAnalytics.setConsent({
type: ConsentType.AnalyticsStorage,
status: consent.value === 'authorized' ? ConsentStatus.Granted : ConsentStatus.Denied
});
}
We get the following error:
VM4026:944 Uncaught (in promise) Error: consentType must be provided.
at returnResult (<anonymous>:944:32)
at win.androidBridge.onmessage (<anonymous>:919:21)
Passing all the types in one parameter would result in only one call.
await FirebaseAnalytics.setConsent({
type: [ConsentType.AnalyticsStorage, ConsentType.AdUserData],
status: consent.value === 'authorized' ? ConsentStatus.Granted : ConsentStatus.Denied
});
No response
No response
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too