-
Notifications
You must be signed in to change notification settings - Fork 200
/
Copy pathapp.component.ts
51 lines (34 loc) · 1.41 KB
/
app.component.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
import { Component, ViewChild } from '@angular/core';
import { Nav, Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { Menu } from '../pages/menu/menu';
import { Signup } from '../pages/signup/signup';
import { OneSignal } from "@ionic-native/onesignal";
@Component({
templateUrl: 'app.html'
})
export class MyApp {
@ViewChild(Nav) nav: Nav;
rootPage: any = 'Menu';
constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen, public oneSignal: OneSignal) {
this.initializeApp();
}
initializeApp() {
this.platform.ready().then(() => {
// Okay, so the platform is ready and our plugins are available.
// Here you can do any higher level native things you might need.
this.statusBar.styleDefault();
this.splashScreen.hide();
// this.oneSignal.startInit('b019dab9-5078-40eb-a958-df477ef9b220', '706507838730');
// this.oneSignal.inFocusDisplaying(this.oneSignal.OSInFocusDisplayOption.InAppAlert);
// this.oneSignal.handleNotificationReceived().subscribe(() => {
// // do something when notification is received
// });
// this.oneSignal.handleNotificationOpened().subscribe(() => {
// // do something when a notification is opened
// });
// this.oneSignal.endInit();
});
}
}