Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hardware backbutton doesn't close app #707

Open
dankawka opened this issue Dec 4, 2018 · 4 comments
Open

Hardware backbutton doesn't close app #707

dankawka opened this issue Dec 4, 2018 · 4 comments
Labels

Comments

@dankawka
Copy link

dankawka commented Dec 4, 2018

I'm submitting a ... (check one with "x")
[X] bug report
[ ] feature request
[ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior:
When I tap hardware back button on my Galaxy S8 application does not close when there are no more "possibilities" to go back.

Expected behavior:
After going back through all pages and being on the last, hardware button should close the app.

Steps to reproduce:

  1. Run app on device
  2. Click any event
  3. Event details page opens
  4. Tap hardware back button
  5. We are back at list of events
  6. Tap hardware back button
  7. Nothing happens <- at this point application should close.
@ionitron-bot ionitron-bot bot added the triage label Dec 4, 2018
@kangjichang2009
Copy link

how to exitApp? ionic3 this platForm.exitApp() has No effect!

@dankawka
Copy link
Author

Switch to Flutter.

@kangjichang2009
Copy link

ionic4 how to exitApp?

@WouterWidgets
Copy link

I'm using this:

In app.component.ts (e.g. inside initializeApp() method)

this.platform.backButton.subscribeWithPriority(0, () => {
  if (!document.querySelector('.ion-page.can-go-back:not(.ion-page-hidden)')) {
    (navigator as any).app.exitApp();
  }
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants