I have imported the FirebaseAnalytics and injected to my class as below:
import {Injectable} from '@angular/core';
import {FirebaseAnalytics} from "@ionic-native/firebase-analytics/ngx";
@Injectable()
export class AnService{
constructor(private fb:FirebaseAnalytics){}
testAnalytics(){
console.log(JSON.stringify(this.fb,null,2)); // logs empty object{}
this.fb.logEvent('page_view', {page: "dashboard"});
// returns an error: object is not a function
}
};
I have included the FirebaseAnalytics in the app.module.ts as provider.
Please help me. Standard events are collected automatically. Firebase is configured ok with my app. But I can’t implement my own events because of this problem above.