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

    Run Quasar in quasar dev mode when using cordova - issues

    Framework
    2
    3
    233
    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.
    • B
      bambinou last edited by bambinou

      Hello,

      I am a bit confused on this.
      When you use Cordova there are events that are set on the app start.
      The problems comes when you try to run your app in “quasar dev” mode in your pc browser, Chrome does not like it as it does not recognise the Cordova event and therefore crashes the app.

      How can I get around this please? Here are some events I use:

      document.addEventListener('deviceready', this.onDeviceReady, false);
          document.addEventListener('offline', this.onOffline, false);
          document.addEventListener('online', this.onOnline, false);
          document.addEventListener('pause', this.onPause, false);
          document.addEventListener('resume', this.onResume, false);
          document.addEventListener('menubutton', this.onMenuKeyDown, false);
          document.addEventListener('backbutton', this.onBackKeyDown, false);
      

      I would really like to test some of my app in the browser quickly because sending the app to the mobile each time takes time.

      Thanks

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

        @bambinou where did you register these events? It should be inside the export defaults ie. inside mounted hook since you are referencing this on your callbacks.

        1 Reply Last reply Reply Quote 0
        • B
          bambinou last edited by

          I added them inside a mounted hook in my App.vue.

          I have found a way to do it:

              if (this.$q.platform.is.cordova) {
                document.addEventListener('deviceready', this.onDeviceReady, false);
                document.addEventListener('offline', this.onOffline, false);
                document.addEventListener('online', this.onOnline, false);
                document.addEventListener('pause', this.onPause, false);
                document.addEventListener('resume', this.onResume, false);
                document.addEventListener('menubutton', this.onMenuKeyDown, false);
                document.addEventListener('backbutton', this.onBackKeyDown, false);
              }
          
          1 Reply Last reply Reply Quote 0
          • First post
            Last post