Halfgeek's Forum Posts

  • There is a bug with LocalStorage in XDK/Safari for iPhones.

    part12studios

    Do you use LocalStorage for iOS and it works fine with CocoonIO?

    I know they implement their own WKWebView, Webserver and such for it, that is different to Cordova and XDK uses.

  • 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

  • RBuster

    LocalStorage/WebStorage will be deleted on iOS when the user's disk space is low. I used WebStorage for my game on iOS8+ and users reported losing their saves and it was a year ago, I found out that iOS is allowed to delete what it considers temporary web files, with WebStorage falls under.

    This is why they want to move to IndexeDB (new LocalStorage), as it's more permanent. There was a bug in iOS8 that still deleted it, but its fixed in iOS9+ and IndexeDB should be more permanent.

    Maybe test CocoonIO if you have a small project, it's free for 2x 50MB projects.

    Intel XDK would not even compile for me, it has problems with installing WKWebView plugins. :/

    iOS Port of my PC game is ready to go, runs great on iPad Mini 2 Safari... but no wrapper works and thanks to the LocalStorage bug, won't work on iPhones. Yep, it's a waiting game.

    Anyway I posted the bug on the bug report:

    But I think this is iOS updates messing up WKWebView/Safari, there seem to be a major difference in iPhone & iPad Safari.

  • Maybe Intel were testing this plugin. I talked with Paul F and AFAIU the plugin will be present in the next XDK update.

    Yep, I'll wait for the next update and re-tested it.

  • > I only tested with Safari preview over wi-fi, I noticed iPhone 6 Plus would not save LocalStorage properly.

    >

    > Did you use XDK or CocoonIO?

    >

    Intel XDK. I never used Cocoon.

    Bad news. I found it: http://gonehybrid.com/dont-assume-local ... ybrid-app/

    It's not that problem. I had that problem in my game on iOS with with iOS8, it would wipe out localstorage when user device run low on disk space.

    That will always be a problem with iOS due to the OS itself having permissions to destroy non-system generated files.

    This bug is a new one. LocalStorage works FINE on Safari on iPad Mini 2 for me, does not work at all on Safari on iPhone 6 Plus. Same OS version, the latest.

  • I only tested with Safari preview over wi-fi, I noticed iPhone 6 Plus would not save LocalStorage properly.

    Did you use XDK or CocoonIO?

  • the new (soon to be released) Intel XDK build system also supports use of the new cordova-plugin-wkwebview-engine for iOS 9 devices which allows the use of the WKWebView (using it on iOS 8 devices automatically falls back to the default UIWebView) -- this will provide substantially improved performance on iOS 9 devices.

    Is this related to the current XDK errors when I try to add the WKWebView plugin?

    Error: Plugin "CordovaWebServer" failed to install.

    Error: Plugin "" failed to install.

    Error: Could not retrieve plugin dependencies for WKWebView Poly '.

    Error: Plugin WKWebView Poly failed to install.

    It can't install the CordovaWebServer, so it can't install Telerik's WKWebView plugin.

    I was guessing it's becaused you need a WebServer to send our game data to the WKWebView, because in iOS8, it would not allow loading from the local files but in iOS9 it does.

    Something along those lines?

  • xmnboy so the wkwebview will only work on iOS 9 and above? I know there are plugins such as https://github.com/Telerik-Verified-Plugins/WKWebView but idk if it works cause I'm using cocoon.io which allows for a great performance for iOS 7+. The only thing I don't like about cocoon is the file size limit of 50mb

    That plugin no longer works for XDK build, it gives an error that it can't install it.

    I think it's due to major changes in WKWebView from iOS8 or iOS9 (where its more stable and properly supports loading the game from local rather than web, which relies on a fake webserver to send our games to it... a hack workaround!).

    xmnboy

    Any news when this new XDK system will be released?

  • Arrays stored in LocalStorage keys as a JSON?

    I do that too, it works fine for Safari on iPad Mini 2. But I did notice on iPhone 6 plus, it would reset. No idea why.

  • I got this error when I built the IPA trough XDK:

    Error: Plugin "CordovaWebServer" failed to install.

    Error: Plugin "" failed to install.

    Error: Could not retrieve plugin dependencies for WKWebView Poly '.

    Error: Plugin WKWebView Poly failed to install.

    I've to remove it from the plugin management. First I thought it was a XDK problem (despite not having any XDK update recently) ), but when I've exported the files from C2 again, this plugin wasn't inserted in the plugin management as happened before. So I thought that it's something related of C2.

    I have the exactly same error message.

    Without that WKWebView plugin, performance falls back to standard UIWebView, and it's horribly slow.

    I'm using r217, so I don't think it's a 223 issue.

    ?

  • I thought this was linked to the ID (ie. com.blah.game) in the project settings as well the Project Name?

    I've had instances in the past, where I change those, and the LocalStorage is no longer accessible. But if I rename it back, it works and retrieves data ok.

  • Did some research, App Preview doesn't allow plugins, so there's no WKWebView acceleration, just default UIWebView, hence, the terrible performance.

    Tried to do the build, got all the certificates and icons done.

    Won't build, failed to install the WKWebView plugin that XDK recommends: https://github.com/Telerik-Verified-Plugins/WKWebView

    Also failed to install the Cordova dependency, WebView Server.

    Le-sigh.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Actually, I prefer to build ipas rather than apks in the XDK. The iOS versions of my games run smoothly on my iPhone 6 whereas my apks having a serious lack of performance in several devices. I think you should give it a try.

    I haven't used XDK for iOS so I didn't know about it.

    Do you use the webview+ plugin for XDK to activate the new Safari iOS8+ performance enhancements?

    I just did a test build on XDK, using the Intel App Preview, over Wi-Fi, getting much worse performance than straight C2 preview over Wi-Fi with Safari.

  • I have tested Webview on Android 5+ with two games and it was still much slower than Crosswalk. Iwrote that in different topic. The comparison of Webview, Crosswalk and Canvas+.

    Then something is broken with XDK.

    Because on Android 5+ devices, the inbuilt browser runs preview over wi-fi very fast.

    Also, you should make a video of your gameplay, so us devs can better judge the performance in context.

    Importantly, this should always be measured: cpuutilisation. It gives a ratio from 0 to 1, 1 = 100% loading of the CPU thread and that's bad.

    So if you get 60 fps and 50% (0.5) cpu usage, that's a great result.

  • I think all this slagging off of C2 and in the process promoting a competing product on Scirra's own homepage is pretty tasteless frankly.

    Not at all, these are serious concerns.

    People should better understand the limitations of C2, despite it being a great engine for intuitive coding.

    Disappointment comes when their expectations are too far above the capabilities of C2.

    I know it's limitations, and sometimes I am upset over the bugs that 3rd party wrappers introduce, but I'm not disappointed with C2 at all. I'm very grateful for it.