philmerrell / capacitor-firebase-analytics

Capacitor plugin that integrates Firebase Analytics for Android and iOS
17 stars 22 forks source link

TypeError: undefined is not an object CapacitorFirebaseAnalytics #17

Open Rosadojonathan opened 4 years ago

Rosadojonathan commented 4 years ago

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 ?

ihsanberahim commented 4 years ago

should be like this,

const { CapacitorFirebaseAnalytics } = Plugins;

CapacitorFirebaseAnalytics.logEvent({ name: 'event_name',  parameters: { id:  id } });