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;
        });
Example #2
0
        }).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();

        });
Example #3
0
   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();
 });
Example #4
0
              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);
              },
Example #5
0
 terminate(event){
    console.log("terminate");
    this.platform.exitApp();
 }
Example #6
0
File: app.ts Project: tejit2004/app
 exitApp(){
    this.platform.exitApp();
 }
Example #7
0
 /**
  * closes the app
  */
 closeApp() {
     this.platform.exitApp();
     LocalNotifications.clear(1);
 }
Example #8
0
 handler: data =>{
   this.platform.exitApp();
 }
Example #9
0
 handler: () => {
   //this.nav.push(Inicio);
   this.alert = undefined;
   this.platform.exitApp();
 }