Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 70999

Dependency injection of FirebaseAnalytics from “@ionic-native/firebase-analytics/ngx” not working, empty object

$
0
0

@msob83 wrote:

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.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 70999

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>