Fabric Crashlytics

Hi all,

I installed https://github.com/sarriaroman/FabricPlugin and i need to know how to import the plugin and simulate a crash, here’s my code :

import {Component} from ‘@angular/core’;
import {Platform, ionicBootstrap} from ‘ionic-angular’;
import {StatusBar} from ‘ionic-native’;
import {TabsPage} from ‘./pages/tabs/tabs’;
import {HTTP_PROVIDERS} from ‘@angular/http’;
import {CloudSettings, provideCloud} from ‘@ionic/cloud-angular’;
import {Push} from ‘ionic-native’;

const cloudSettings: CloudSettings = {
‘core’: {
‘app_id’: ‘363e500b’
}
};

@Component({
template: ‘<ion-nav [root]=“rootPage”>’,
providers: [HTTP_PROVIDERS]
})
export class MyApp {

private rootPage: any;

constructor(private platform: Platform) {
this.rootPage = TabsPage;

window.fabric.Crashlytics.sendCrash();

platform.ready().then(() => {


  StatusBar.styleDefault();

  var push = Push.init({
    ios: {
      alert: "true",
      badge: true,
      sound: 'false'
    }
  });

  push.on('registration', (data) => {
    console.log(data.registrationId);
    alert(data.registrationId.toString());
  });

  push.on('notification', (data) => {
    console.log(data);
    alert("Hi, Am a push notification");
  });

  push.on('error', (e) => {
    console.log(e.message);
  });


});

}
}

ionicBootstrap(MyApp, [provideCloud(cloudSettings)]);

Thanks

1 Like

Hey, I would like to implement Fabric as well. @dpmco did you manage to get it running?

I’m interested in this as well. I tried to bring in cordova-fabric-plugin. Crashlytics is able to register the sessions and app with Fabric.io however any crash logging, forced crashes (for testing) or metrics in Answers don’t make it through the plugin to Fabric.io. Does anyone have a better Fabric plugin or have any insight into why this plugin seems to have issues with Ionic2?

Related:


hey if you find solution plz let me.