firebase-utils-module
v0.0.14
Published
firebase suite module (Analytics, Authentication, Crashlytics, Messaging) for Ionic
Downloads
5
Readme
Firebase suite module
Desription here (pending)
Developing
run commands:
npm i @ionic-native/core@3 npm i @ionic-native/firebase
then for buillding and publishing: [optionally: npm login] [optionally: sudo] npm run build npm publish
you can build any times you want but make sure to increment version before publishing
Using your module in an Ionic 2 app
import { NgModule } from '@angular/core';
import { IonicApp, IonicModule } from 'ionic-angular';
import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
// Import your module
import { MyModule } from 'ionic-module-template';
@NgModule({
declarations: [
MyApp,
HomePage
],
imports: [
IonicModule.forRoot(MyApp),
MyModule // Put your module here
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
],
providers: []
})
export class AppModule {}
//---------- Also in a component (page)
import { Component } from '@angular/core';
import { Firebase } from '@ionic-native/firebase';
import {MyProvider} from 'firebase-utils-module';
@Component({
selector: 'app-home',
templateUrl: 'home.page.html',
styleUrls: ['home.page.scss'],
})
export class HomePage {
token = "";
constructor(myFirebase: MyProvider) {
myFirebase.getToken()
.then(t => this.token = t)
.catch(e => console.error(e));
}
}