Localstorage is cleared after App restart on ios

0 favourites
  • 6 posts
From the Asset Store
Create your own casino app and import it to Google Play and the App Store.
  • Hey guys,

    i've got a problem with my Localstorage under IOS.

    I want to save some variables in an Array. If i set the Array width to 5 and save 3 Variables in it, it works perfectly.

    Otherwise if i set the Array width to 5+ and save 5+ Variables, the localstorage is cleared when i restart the app.

    I'm compiling with XDK. I tried with phonegap and Cocoon... same problem.

    IOS Target version 8+.

    Has anyone experience with this problem?

    About an answer I would be delighted.

    greetings

    Domenic

  • Does this only happen after export to Ios?

    Could you share your events?

    You are talking about arrays, variables and localstorage..

    I guess you are saving the array AsJson, which should include the size of the array, if I remember correctly..

    Are you retrieving the variables from the Array in the right way?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Does this only happen after export to Ios?

    Could you share your events?

    You are talking about arrays, variables and localstorage..

    I guess you are saving the array AsJson, which should include the size of the array, if I remember correctly..

    Are you retrieving the variables from the Array in the right way?

    Thank you for your quick response

    Yes, only on IOS. On Android it works perfectly.

    https://www.dropbox.com/s/1t6irzjeysck1z1/1.png?dl=0

    https://www.dropbox.com/s/7og0e3k655a20sr/2.png?dl=0

    Here is my code (saving & loading).

    Yes i'm using the AsJson array, but i don't know if it includes the size of the array. I set the array manually.

    Yeah, on Android all variables retrieves correctly.

  • Ok..

    I'm not sure why you use the variable String inbetween..

    I don't see any event changing the array-size, or did you mean setting it inside the editor?

    Also I'm not sure why you seperate event 13,14,15 and 16

    But I can't see why this would work on android and not on iOS..

  • Ok..

    I'm not sure why you use the variable String inbetween..

    I don't see any event changing the array-size, or did you mean setting it inside the editor?

    Also I'm not sure why you seperate event 13,14,15 and 16

    But I can't see why this would work on android and not on iOS..

    I set my values to the string and save the String in the array

    Yep, i set the size in the editor.

    Yeah, your right. I should make one event... idk why i did that

    Hmm, no problem.

    Thank you for your help.

  • Hi Guys,

    I use r231 and after compiling with CocoonJs cloud(webview+ mode) I have construct 2 system save/load don't work.

    It works fine if I compile with Phonegap but webview+ gives much more efficient CPU usage.

    Please advise if any ideas to save load in CocoonJS?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)