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

Platform.backButton.subscribeWithPriority doesn't manage priorities #17824

Takkuz opened this issue Mar 19, 2019 · 4 comments


Copy link

commented Mar 19, 2019

Bug Report

Ionic version:
[x] 4.x

Current behavior:
The method subscribeWithPriority doesn't manage priority properly: it doesn't matter which priority I've set, it doesn't go back throught the stack. If I set a low priority it hides popups but still doesn't change page.

It seems a bug but there's any documentation for that method, so I don't know if I'm using it wrong or it's deprecated without any warning.

Expected behavior:
Like in previous Ionic versions I was expecting to leave back working properly for pages using correct priority level.

Steps to reproduce:
Create a blank app with Android platform, add a second page, and manage .backButton.subscribeWithPriority() inside app.component.ts

Related code:

  initializeApp() {
    this.platform.ready().then(() => {

      this.platform.backButton.subscribeWithPriority(601, async () => {
        console.log('Back Pressed');

Ionic info:


   ionic (Ionic CLI)             : 4.12.0
   Ionic Framework               : @ionic/angular 4.1.1
   @angular-devkit/build-angular : 0.12.4
   @angular-devkit/schematics    : 7.2.3
   @angular/cli                  : 7.2.4
   @ionic/angular-toolkit        : 1.3.0


   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 8.0.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.1.3, cordova-plugin-ionic-webview 3.1.2, (and 13 other plugins)


   Android SDK Tools : 26.1.1 (/opt/android-sdk)
   NodeJS            : v10.15.3 (/home/vittorio/.nvm/versions/node/v10.15.3/bin/node)
   npm               : 6.4.1
   OS                : Linux 4.18

@ionitron-bot ionitron-bot bot added the triage label Mar 19, 2019

This comment has been minimized.

Copy link

commented Mar 22, 2019

Hi there,

Thanks for opening an issue with us! Can you provide a repository with the code required to reproduce this issue?


@ionitron-bot ionitron-bot bot removed the triage label Mar 22, 2019

This comment has been minimized.

Copy link

commented Mar 26, 2019

Hi, thank you.

I provided a repository with the code you need:

On tab2 there is a button to go to tab2-page2, on that page you can change dinamically the priority of the hardware backButton on Android. Using no value or <0 or NaN value removes the subscription.

As you can see, without subscription you can use hardware backButton to go to previous page; with priority 0 to 100 it closes popup, as expected, but you doesn't go to previous page; from 101 and above even the popup isn't handled anymore.

As far as I can remember, from previous Ionic versions, under priority 100 is handled only if there is any page on the stack because going back on page has priority 100.


This comment has been minimized.

Copy link

commented Apr 4, 2019

Hi there,

Thanks for the repo! I was able to reproduce this issue.

I have added this issue to our Hardware Back Button Issue Tracker. We will look into this!

Thanks for using Ionic!


This comment has been minimized.

Copy link

commented Jul 22, 2019

Being able to control your navigation stacks and clicks etc should be the absolute basics.
Yet this is open for 4 months.

It shouldn't have been out of beta or RC stage yet with this kind of bugs.

But now I'm stuck with it, people above are waiting for an explanation for delays and best I can tell them is "ionic has major bugs but they haven't fixed them".
And release is delayed again - which means financial impact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.