Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /////////////////
- /////////////////
- app.component.ts
- /////////////////
- /////////////////
- `import { Component } from '@angular/core';
- import { Platform} from 'ionic-angular';
- import { StatusBar } from '@ionic-native/status-bar';
- import { SplashScreen } from '@ionic-native/splash-screen';
- import { TabsPage } from '../pages/tabs/tabs';
- import { Push, PushToken } from '@ionic/cloud-angular';
- @Component({
- templateUrl: 'app.html'
- })
- export class MyApp {
- rootPage:any = TabsPage;
- constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, public push: Push) {
- platform.ready().then(() => {
- statusBar.styleDefault();
- splashScreen.hide();
- this.push.register().then((t: PushToken) => {
- return this.push.saveToken(t);
- }).then((t: PushToken) => {
- console.log('Token saved:', t.token);
- });
- this.push.rx.notification()
- .subscribe((msg) => {
- alert(msg.title + ': ' + msg.text);
- });
- });
- }
- }
- `
- /////////////////
- /////////////////
- app.module.ts
- /////////////////
- /////////////////
- import { CloudSettings, CloudModule } from '@ionic/cloud-angular';
- const cloudSettings: CloudSettings = {
- 'core': {
- 'app_id': 'XXXXXX'
- },
- 'push': {
- 'sender_id': 'XXXXX',
- 'pluginConfig': {
- 'ios': {
- 'badge': true,
- 'sound': true
- },
- 'android': {
- 'iconColor': '#ff0000'
- }
- }
- }
- };
- @NgModule({
- declarations: [
- MyApp,
- ContactPage,
- HomePage,
- TabsPage,
- Account,
- LastRatingPage,
- MyInformationPage,
- SettingNotifPage,
- LoginPage,
- RegisterPage,
- MenuPage,
- MyRatingPage,
- IntroPage
- ],
- imports: [
- BrowserModule,
- HttpModule,
- IonicModule.forRoot(MyApp),
- IonicStorageModule.forRoot(),
- CloudModule.forRoot(cloudSettings)
- ],
- bootstrap: [IonicApp],
- entryComponents: [
- MyApp,
- ContactPage,
- HomePage,
- TabsPage,
- Account,
- LastRatingPage,
- MyInformationPage,
- SettingNotifPage,
- LoginPage,
- RegisterPage,
- MenuPage,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement