Quantcast
Channel: Ionic Framework - Ionic Forum
Viewing all articles
Browse latest Browse all 48980

Hardware back button destroys the app

$
0
0

I’m an Ionic 5.6 application with Angular 12, the problem is when I press the hardware back button anywhere in the app, my app gets closed.
I’ve subscribed the backButton in my home page component like this

 platform.backButton.subscribeWithPriority(1, () => {
      if (this.router.url === '/home')
      {
        this.router.navigate(['/home']);

        return;
      }
      else
      {
        this.location.back();
      }

    });

But even if I completely remove this code, I still have the same behavior.
What could possibly be the problem.

This is the logcat logs when I press the hardware back button

2021-07-04 13:31:30.348 8980-8980/com.garageapp.user D/Capacitor: App paused
2021-07-04 13:31:30.966 8980-8980/com.garageapp.user D/Capacitor: App stopped
2021-07-04 13:31:30.973 8980-8980/com.garageapp.user D/Capacitor: App destroyed

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 48980

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>