LocalStorage does not work on Safari for iPhone 6 Plus

0 favourites
  • 11 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Problem Description

    Stored game data in keys in LocalStorage cannot be retrieved in a new session, once Safari is closed and re-launched again for preview over Wi-Fi. It seems to be resetting, which shouldn't happen as far as I am aware, since the IP & port is static.

    Attach a Capx

    Any simple implementation of LocalStorage will show this. Store a key, re-launch, recall a key, it's empty.

    Steps to Reproduce Bug

    • Preview a CAPX over wi-fi
    • Set a LocalStorage key
    • Close Safari
    • Re-launch Safari and load up the preview
    • Get the key, it's empty

    Observed Result

    No LocalStorage persistence.

    Expected Result

    LocalStorage should persist in new app launches.

    Affected Browsers

    • Chrome: NO
    • FireFox: NO
    • Internet Explorer: NO
    • Safari: YES

    Operating System and Service Pack

    Latest iOS version. iPhone 6 Plus Safari.

    This bug DOES NOT exist for Safari on my iPad Mini 2. It is a very strange one and I suspect it's the fault of iOS again...

    Construct 2 Version ID

    217 & 223 both have same issue

  • Sounds like sandboxing.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Sounds like sandboxing.

    Yep, it used to be a problem with iOS8 and WKWebView, it would reset the LocalStorage. Was fixed in iOS9... now bugged again for iPhone... freaken Apple.

  • I can't reproduce on IPhone 6s (non-Plus). Can you test chrome for ios? Just to be sure that it's WKWebView bug.

  • Can't reproduce on an iPad Air 2 with iOS 9.3 on r224. Given that iOS devices are usually pretty consistent and there are no other reports of this, it sounds like it's specific to your device. Are you sure you haven't set some privacy settings or content blockers that will block storage access?

  • Can't reproduce on an iPad Air 2 with iOS 9.3 on r224. Given that iOS devices are usually pretty consistent and there are no other reports of this, it sounds like it's specific to your device. Are you sure you haven't set some privacy settings or content blockers that will block storage access?

    You mean there's a privacy setting that can block LocalStorage? I did not know that. I'll check it out.

    This problem doesn't occur on my iPad Mini 2 or Air. Only on iPhone 6 Plus. I don't have a normal iPhone 6 to test.

  • Yes, there are lots of features to control what is stored on your device, such as private browsing - that would wipe storage when you close the tab. Some browsers refer to all local storage as "cookies" for historical reasons, so if you've done something like disable cookies then that can disable local storage as well.

  • Yes, there are lots of features to control what is stored on your device, such as private browsing - that would wipe storage when you close the tab. Some browsers refer to all local storage as "cookies" for historical reasons, so if you've done something like disable cookies then that can disable local storage as well.

    Thanks, I did not know that.

    Would those settings disable LocalStorage for wrapped C2 games that use WKWebView?

  • No, I don't think so, the browser settings only affect the browser.

  • "Save game to slot" uses the same storage like "Local Storage" ?

  • Did you resolve the problem? I'm facing the same issue. I tested my game on iPhone 6s and iPad Air. The game has few videos that are to be played only one time. In order to make this work I used localstorage to identify whether a video is played for the first time. The first video is playing only one time but the rest are playing every time I launch the app. Not only videos but also all the scores are being whipped out.

    Is there a way to solve this? I updated the iOS to 10.2 on both the devices.

    Please help.

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