Local Storage Not Cleared when switching simulators

7 posts, 0 answers
  1. skobyjay
    skobyjay avatar
    15 posts
    Member since:
    Jul 2010

    Posted 20 Feb 2013 Link to this post

    hello,

    This might be intentional but I have noticed after I store something in local storage using the code below and I change simulators ( for example iphone to andriod ) the sims are sharing the local storage and the "initial value" isn't set each time I change devices as I would expect (I would expect that "myobject" wouldn't exist in local storage for the newly opened sim since it has not been run yet). In order to work around this I have to close out the IDE completely and reopen to switch devices or I could write code to clear it out regardless each time the page is run.

      if (window.localStorage.getItem("myobject") === null) {
                    localStorage.setItem("myobject", "intial value");
                }

  2. Kristina
    Admin
    Kristina avatar
    57 posts

    Posted 21 Feb 2013 Link to this post

    Hello,

    The local storage is per domain and its default behavior is to persist after you refresh, reload, change device info or even close the Simulator. As you suggested, the only way to reset it is through code in you java script file.

    Thank you for using Icenium!

     

    Regards,
    Kristina
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Pluralsight.
  3. skobyjay
    skobyjay avatar
    15 posts
    Member since:
    Jul 2010

    Posted 21 Feb 2013 Link to this post

    Shouldn't the local storage be reset if you change devices because that's how it would work in the real world. Every device would have its own local storage 
  4. skobyjay
    skobyjay avatar
    15 posts
    Member since:
    Jul 2010

    Posted 21 Feb 2013 Link to this post

    another problem with the local storage not being reset when the simulator window is closed , and you change the underlying data stored in the local storage. then the data property changes are not recognized.
  5. Matt
    Matt avatar
    9 posts
    Member since:
    Oct 2012

    Posted 22 Feb 2013 Link to this post

    It seems the underlying issue is that we need a way to force a complete reload - reloading all of the files, clearing the UIWebView cache, clearing local storage, etc. Essentially, we want to be able to run our app as if it's the first time it has been loaded on the device. Doing all of that programatically isn't really ideal for a testing / real-world simulation. This is applicable to both the simulator and Ion.
  6. skobyjay
    skobyjay avatar
    15 posts
    Member since:
    Jul 2010

    Posted 22 Feb 2013 Link to this post

    I couldn't agree more 
    Matt said:It seems the underlying issue is that we need a way to force a complete reload - reloading all of the files, clearing the UIWebView cache, clearing local storage, etc. Essentially, we want to be able to run our app as if it's the first time it has been loaded on the device. Doing all of that programatically isn't really ideal for a testing / real-world simulation. This is applicable to both the simulator and Ion.
  7. Kristina
    Admin
    Kristina avatar
    57 posts

    Posted 25 Feb 2013 Link to this post

    Hey guys,

    Thank you very much for your feedback. We would definitely try to improve the behavior of Simulator Local Storage for one of our next versions. 

    Greetings,
    Kristina
    the Telerik team

    Share feedback and vote for features on our Feedback Portal.
    Want some Kendo UI online training - head over to Pluralsight.
Back to Top