• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM HELP ME!! does not work save ini in ios HTML5

Z

Zanget

Guest
the save ini works for both the computer and for android but when I try it on iphone or ipad, it just does not work for me, what are the possible reasons why it does not work? because it works on the other platforms and not on ios? What should I do to make it work properly for me? I need your help urgently I have my project paused for weeks for this problem, I thank you for your help in advance.
 
Z

Zanget

Guest
Thanks for the answer, I will try it but before I forgot to mention that the game exported them for html5, the Text File in html5 will not bring me problems ??
 

chmod777

Member
When you use the ini_* functions for that purpose, the browser's local storage API is used.
https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage

So that means your ini won't be saved:
- if the browser does not support the localStorage property.
- or usually if you run the browser in private mode, the data will be removed once you've closed the window (or any similar configuration).

Plus, according to the link above, iOS Safari is a special case:
Starting with iOS 5.1, Safari Mobile stores localStorage data in the cache folder, which is subject to occasional clean up, at the behest of the OS, typically if space is short. Safari Mobile's Private Browsing mode also prevents writing to localStorage entirely.
 
Z

Zanget

Guest
Incredible, now I understand everything perfectly, I never kept the data because I always went into private ios mode, I just checked on my ipad and try the normal navigation game and everything goes perfect, thanks for that, now is there a way that Safari private browsing allows me to read my ini files correctly?
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
Incredible, now I understand everything perfectly, I never kept the data because I always went into private ios mode, I just checked on my ipad and try the normal navigation game and everything goes perfect, thanks for that, now is there a way that Safari private browsing allows me to read my ini files correctly?
Private browsing likely wipes the data either once the page closes or when the session ends, which would make perfect sense as otherwise you could still be identified and tracked by websites easily and the feature would have been worthless.
 
Z

Zanget

Guest
the problem is that when testing my game in the private browsing and pass a level and go to the selection menu shows me that no level is unlocked, as if the ini file did not work, I understand that when closing the page do not save any data It's fine with that, but while you're playing the game should unlock levels work for the player to enjoy the game correctly.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
the problem is that when testing my game in the private browsing and pass a level and go to the selection menu shows me that no level is unlocked, as if the ini file did not work, I understand that when closing the page do not save any data It's fine with that, but while you're playing the game should unlock levels work for the player to enjoy the game correctly.
Not reloading the game state from INI file unless on game start would solve this.
 
Top