this.platform.registerBackButtonAction(() => { if (this.isMessagesOpened) { this.isMessagesOpened = false; return; } if (this.navPath.length < 1) { if (new Date().getTime() - lastTimeBackPress < timePeriodToExit) { this.platform.exitApp(); } else { let toast = this.toastCtrl.create({ message: 'Press back again to exit', duration: 3000, position: 'bottom' }); toast.present(); lastTimeBackPress = new Date().getTime(); } return; } this.navPath.pop(); this.slide = this.navPath[this.navPath.length - 1]; this.slides.slideTo(this.slide); this.isGoingBack = true; });
}).catch(e => { let alert = this.alertCtrl.create({ title: 'Fatal Error!', subTitle: 'Unable to get service end-point. Please contact admin.', buttons: ['OK'] }); alert.present(); platform.exitApp(); });
error=>{ loading.dismissAll(); console.log(error); let alert = this.alertCtrl.create({ title: 'Fatal Error!', subTitle: 'Unable to get service end-point. Please contact admin.', buttons: ['OK'] }); alert.present(); platform.exitApp(); });
data => { loading.dismissAll(); let url = data.serviceBaseUrl; console.log('Service end-point: ' + url); if (url === undefined) { let alert = this.alertCtrl.create({ title: 'Fatal Error!', subTitle: 'Unable to get configuration for service end-point. Please contact admin.', buttons: ['OK'] }); alert.present(); platform.exitApp(); } else this.startLogin(url); },
terminate(event){ console.log("terminate"); this.platform.exitApp(); }
exitApp(){ this.platform.exitApp(); }
/** * closes the app */ closeApp() { this.platform.exitApp(); LocalNotifications.clear(1); }
handler: data =>{ this.platform.exitApp(); }
handler: () => { //this.nav.push(Inicio); this.alert = undefined; this.platform.exitApp(); }