Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ionic Native: tried accessing the FlurryAnalytics plugin but it's not installed #35

Open
dlazzy opened this issue Feb 8, 2019 · 0 comments

Comments

@dlazzy
Copy link

dlazzy commented Feb 8, 2019

Hello,

There is my specs :

cli packages:

    @ionic/cli-utils  : 1.19.2
    ionic (Ionic CLI) : 3.20.0

global packages:

    cordova (Cordova CLI) : 7.1.0 

local packages:

    @ionic/app-scripts : 3.2.1
    Cordova Platforms  : android 6.4.0
    Ionic Framework    : ionic-angular 3.9.2

System:

    Android SDK Tools : 26.1.1
    Node              : v7.8.0
    npm               : 5.7.1 
    OS                : Linux 4.15

The plugin version is :

"@ionic-native/flurry-analytics": "^4.20.0"
"cordova-plugin-flurryanalytics": "^1.4.6"

Code is (in app.component.ts) :

import { Component, ViewChild } from '@angular/core';
import { Platform, Nav } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { OneSignal } from '@ionic-native/onesignal';
import { FlurryAnalytics, FlurryAnalyticsObject, FlurryAnalyticsOptions } from '@ionic-native/flurry-analytics';
import { OS_APP_ID, OS_PROJECT_ID, FA_APP_ID } from '../providers/config';

@Component({
  templateUrl: 'app.html'
})
export class mApp {
  @ViewChild(Nav) navChild: Nav;
  rootPage: any;
  options: FlurryAnalyticsOptions = {
    appKey: FA_APP_ID,
    reportSessionsOnClose: true,
    enableLogging: true
  };
  fa: FlurryAnalyticsObject;

  constructor(private platform: Platform,
    private statusBar: StatusBar,
    private splashScreen: SplashScreen,
    private oneSignal: OneSignal,
    private flurryAnalytics: FlurryAnalytics) {

    this.fa = this.flurryAnalytics.create(this.options);
    this.initializeApp();
  }

  initializeApp() {
    this.platform.ready().then(() => {
      if (window.hasOwnProperty('cordova')) {
        this.oneSignal
          .startInit(OS_APP_ID, OS_PROJECT_ID)
          .inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.Notification)
          .endInit();
        this.fa.logEvent('open app')
          .then(() => console.log('Logged open app'))
          .catch(e => console.log('Error logging the event open app', e));
      }
      this.rootPage = 'HomePage';
      this.statusBar.styleLightContent();
      this.statusBar.backgroundColorByHexString('#292929');
      this.splashScreen.hide();
    });
  }
}

When compiling app to Android phone with ionic cordova build android it works perfectly, when compiling with ionic cordova build android --prod this show an error in console Ionic Native: tried accessing the FlurryAnalytics plugin but it's not installed.

Thanks for the help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant