попробуйте ниже код this.platform.exitApp ();
constructor(public platform : Platform){
this.platform.registerBackButtonAction(() => {
if (this.alertShown == false) {
this.presentConfirm();
this.alertShown = true
}
}, 0);
}
presentConfirm() {
let alert = this.alertCtrl.create({
title: 'Confirm',
message: 'Do you want to exit?',
buttons: [
{
text: 'Cancel',
role: 'cancel',
handler: () => {
console.log('Cancel clicked');
this.alertShown = false;
}
},
{
text: 'Yes',
handler: () => {
console.log('Yes clicked');
this.platform.exitApp();
}
}
]
});
alert.present().then(() => {
//this.alertShown=true;
});
}