capacitor-firebase-analytics
capacitor-firebase-analytics copied to clipboard
TypeError: undefined is not an object CapacitorFirebaseAnalytics
Hi there,
I'm running into some issues when trying to get the CapacitorFirebaseAnalytics plugin to work.
I import the library:
import { Plugins } from '@capacitor/core' import { CapacitorFirebaseAnalytics } from 'capacitor-firebase-analytics'
and setUserID like this:
Plugins.CapacitorFirebaseAnalytics.setUserID({ value: user.eureciaId })
but I get a TypeError: undefined is not an object (evaluating '_capacitor_core__WEBPACK_IMPORTED_MODULE_2__["Plugins"].CapacitorFirebaseAnalytics.setUserID')
error in the console
Did I miss some steps in the plugin installation/config ?
should be like this,
const { CapacitorFirebaseAnalytics } = Plugins;
CapacitorFirebaseAnalytics.logEvent({ name: 'event_name', parameters: { id: id } });