I have a angular 14 and capicatorjs v6 android app project, In that app I am trying to open a popup on mobile back button press,
In my login page (which is entry point of app) as I hit back button popup does not open, but as i hit login button of my loggin page the popup suddenly appears. The popup open and close fine in after login pages, but not in login page.
//Variable which will open a dialog as it will be true
dialogState: boolean = false;
ngAfterViewInit() {
CapacitorApp.addListener('backButton', () => {
this.dialogState = true;
});
}
onNoClick() {
this.dialogState = false;
}
onYesClick() {
this.dialogState = false;
CapacitorApp.exitApp();
}
New contributor
Black Fox is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.