@dpmco wrote:
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: '',
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
Posts: 1
Participants: 1