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

    localStorage and Cordova

    Help
    2
    3
    1097
    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.
    • M
      mas last edited by mas

      Goodday,

      I use localStorage in my Quasar app for mobile via Quasar Wrapper for webstorage. The wrapper is used inside vue files as
      this.$q.sessionStorage.set(key, value).
      In desktop broswers the app works flawlessly and localStorage works as it should for saving\retrieving data. However, it doesn’t work on Genymotion emulator and when I install the application on a mobile device using Cordova. I ran this simple code inside my quasar code recommened for testing webstorage:

      if (typeof(Storage) !== “undefined”) {
      // Code for localStorage/sessionStorage.
      } else {
      // Sorry! No Web Storage support…
      }

      The code detects webstorage on both Genymotion and mobile device. Maybe Cordova+Quasar combination requires additional steps to access localStorage I’m not aware of?

      Thank you!

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

        it should still work, cordova just wraps your app in a webView which is like a browser and has access to local/sessionStorage api.

        1 Reply Last reply Reply Quote 0
        • M
          mas last edited by

          Yes, thanks, I can use i like this and it works:

          window.localStorage.setItem(‘settings’, JSON.stringify(this.settings))

          But I found no way to use Quasar wrapper with Cordova which was really convenient.

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