No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    back button in android using Quasar 0.16

    Help
    5
    11
    1777
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • L
      liuzhongshu last edited by liuzhongshu

      I upgraded to quasar 0.16 from 0.14 recently, my app has a start page, and auto jumps to different pages based on some conditions, in the target page, I just want exit when back button is pressed, but the route is not “#/”.

      I found some behaviors were different with quasar v0.14, In 0.16:

      1. When using debug version(quasar dev -m cordova -T android), the back button works as expected, but I can not register backbutton event using following code:
        mounted () {
          if (this.$q.platform.is.cordova) {
            document.addEventListener('backbutton', this.onBackButton, false)
          }
          if (this.$store.getters.isFinished()) {
            this.$router.replace('/repo')
          }
        },
      

      onBackButton method never get fired when I pressed the back button.

      1. When using release version(quasar build -m cordova -T android), the back button behavior changed, I can not exit app when i am not in ‘#/’ route. seems it’s a new design of quasar 0.15, but why?

      And very strange, now the event works, then I can add this code to “fix” the behavior:

          onBackButton: function (e) {
            e.stopPropagation()
            navigator.app.exitApp()
          }
      

      But everything works fine in quasar 0.14. Maybe I misunderstood something?

      1 Reply Last reply Reply Quote 0
      • nothingismagick
        nothingismagick last edited by

        @liuzhongshu - just to remind you: Quasar is moving very fast and we are closing in on our stable 1.0 release. 0.14 was a stage in the evolution of Quasar that I also enjoyed, but a lot has happened since then. Until we get to 1.0, EVERYTHING is subject to change and although the framework is pretty stable, you can expect some behaviours to change as we get bug reports and developer feedback.

        1 Reply Last reply Reply Quote 0
        • L
          liuzhongshu last edited by

          @nothingismagick yes, I know that, quasar is great. I just want to know if any other one have same issue with me, or maybe I misunderstood something?

          1 Reply Last reply Reply Quote 0
          • L
            liuzhongshu last edited by

            After several days of debugging, I found that onMessageFromNatives in cordova.js could not be triggered under the debug version(quasar dev) using quasar 0.16, I have created an issue on github.

            https://github.com/quasarframework/quasar/issues/2267

            1 Reply Last reply Reply Quote 0
            • D
              dsky last edited by

              @liuzhongshu I have a similar problem after upgrading from 0.14 to 0.16. For me the back button is not working or only after you press it multiple times and then it jumps back multiple steps in the history. Did you see this problem too and have a solution? Getting pretty frustrated as I haven’t changed anything. Any insight would be greatly appreciated.

              C 1 Reply Last reply Reply Quote 0
              • P
                pd76 last edited by pd76

                @liuzhongshu @dsky related https://github.com/quasarframework/quasar/issues/1897

                1 Reply Last reply Reply Quote 0
                • L
                  liuzhongshu last edited by

                  @dsky Your problem seems to be related to hardware, have you tried changing a mobile phone?

                  1 Reply Last reply Reply Quote 0
                  • D
                    dsky last edited by

                    @liuzhongshu I have tried multiple phones with all the same result, I really believe it is a quasar 0.16 issue

                    1 Reply Last reply Reply Quote 0
                    • P
                      pd76 last edited by

                      @dsky https://forum.quasar-framework.org/topic/2481/quasar-quasar-cli-v0-17-aka-ssr-developer-preview/

                      Quasar 0.17 refactors how the back button is handled. Please test this version (beta).

                      cordova: {
                        iosStatusBarPadding: true/false, // add the dynamic top padding on iOS mobile devices
                        backButtonExit: true/false // Quasar handles app exit on mobile phone back button
                      }
                      1 Reply Last reply Reply Quote 0
                      • L
                        liuzhongshu last edited by

                        I find my issue is related with android version, with android 5.1, the problem exists, but under android 7, it does not exist.

                        1 Reply Last reply Reply Quote 0
                        • C
                          channimol @dsky last edited by

                          @dsky I have same problem but I am using quasar 0.15. have you solved your problem?

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post