Platform.backButton.subscribeWithPriority doesn’t manage priorities

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.statusBar.styleDefault();
      this.splashScreen.hide();

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

Ionic info:

Ionic:

   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 (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)

System:

   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

Author: Fantashit

1 thought on “Platform.backButton.subscribeWithPriority doesn’t manage priorities

  1. 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.

Comments are closed.