i try different app (conference app- blank app) its worked but i try my app it doesn’t work .
I’ve been struggling 2 days I could not find the cause
my app.component
rootPage: any;
public counter = 0;
constructor(
public platform: Platform,
public statusBar: StatusBar,
public splashScreen: SplashScreen,
public app: App,
public toastCtrl: ToastController,
public splitPane: SplitPane,
public menu: MenuController,
i want to double tab backbutton for exiting from application. but didnt worked. and not worked nav.push page stacking , and other back button features before. in any event back button is close the app
You are initializing the function when the app is starting.
Resulting in = App closes because of: this.platform.exitApp();
[The problem could be that your counter is NOT working and it just runs the else code! Maybe adding a console.log would show if the counter is really working or not.]
Bind this code somewhere in your typescript but not in the initialized function.
(Idk if your counter is working or not Im asuming it works for now, but I see a mistake in here.)
Im also not sure why this: 0) is present in the end of your codeline. You also should be able to initialize it again with your function with this code.
If that doesn’t work. You might just add a Backbutton in the HTML yourself and create a function for it and bind this code to it just without this.platform.registerBackButtonAction(() => {