-
-
Notifications
You must be signed in to change notification settings - Fork 130
Open
Labels
Description
Plugin(s)
- Analytics
- App
- App Check
- Authentication
- Crashlytics
- Cloud Firestore
- Cloud Functions
- Cloud Messaging
- Cloud Storage
- Performance
- Remote Config
Current problem
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)
Preferred solution
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
});
Alternative options
No response
Additional context
No response
Before submitting
- I have read and followed the feature request guidelines.
- I have attached links to possibly related issues and discussions.
eleventhaus