System Save, Load and local storage do not work after compile with Cocoon.io to iOS (webview mode)


#1

Problem Description
System Save, Load and local storage do not work after compile with Cocoon.io to iOS (webview mode)
Attach a Capx
any system save/load operation
https://www.dropbox.com/s/2wsoblqh7ny4f … .capx?dl=0
Description of Capx
Blue sprite becomes red in 5 seconds. After that system save comes to action.
By pressing green sprite you can system load to the moment when blue sprite becomes red
Steps to Reproduce Bug

Step 1 - Export Project as Cordova (minify unchecked, WKWebView unchecked)
Step 2 - delete xml file
Step 3 - Achieve project and put to cocoon.io cloud
Step 4 - delete all plugins expect ios plugin (com.ludei.webviewplus.ios) in cocoon.oi
Step 5 - Compile project as native app with option webview+ to iOS
Step 6 - Download compiled achieve and open in XCODE
Step 7 - Export from XCODE as for Ad HOC Deployment
Step 8 - app.ipa file and copy it to i_tunes
Step 9 - Connect iOS device and install app on it
Step 10 - Run app and play until one of the save points.
Step 11 - Fully quit app and run from the begining
Step 12 - Load from the saved slot - data on slot fully lost
Or

[] install Cocoon Dev on iOS device
[
] Run preview mode in http://192.168.0.1:50000 in Construct 2
[*] Run Construct 2 game in Cocoon Dev with web view or webview+ mode

Observed Result
After app is fully quit (swiped off ) in iOS, local storage data are lost.
Load and Save work during app is not fully closed.
Expected Result
Use save load system function, store data into local storage
Affected Browsers
Chrome: NO
FireFox: NO
Internet Explorer: have not checked
Safary: NO
Gapphone - published as native app to iOS - NO
Cocoon.io - published as native app to iOS - YES with option webview and webview+
Cocoon.io - published as native app to iOS - NO with option canvas+
Cocoon dev app - as preview 192.168.0.100:50000 -NO if run as canvas+
Cocoon dev app - as preview 192.168.0.100:50000 -YES if run as webview+ and webview

Operating System and Service Pack
OS X EL Capitan v. 10.11.5 (Construct 2 runs on virtualbox, Windows 10 64-bit )
Construct 2 Version ID r231 64-bit, same in r227(stable)


Local storage does not work when compiled to iOS using webview +
1 hr. ago my project still compile (project size only 3.4m) Upgrade to silver package but still fail!
(iOS) Webstorage or Localstorage not work on WebView+
#2

Hi @karlykhanov.s

Thank you for your report, but your link to the capx file is broken.
Can you please re-submit the link to the test case?

Thank you!


#3

HI Andy,

I’m sorry for link broken!

Please see link below,

Thank you,

Sergey


#4

Hi @karlykhanov.s

Thanks for the file. I was able to reproduce your issue. It works fine in Canvas+ but it doesn’t save the progress for WebView+. This is something @imanolm1 has to check.

@imanolm1
Please try this zip file in the offical Cocoon Developer app for iOS.

It works fine while running in Canvas+, but it loses the savegame in WebView+

Reproduce the issue

  1. Run the zip file with WebView+ and wait till it saves (you got a message then)
  2. Close the app and start it again.
  3. Click on the green button to load it (before the other button gets violet which happens after 5 seconds when the save is triggered)
  4. you will get an error message then.

Try the same while running Canas+ and all works fine.

Thank you!

Regards
Andy


#5

Hi @imanolm1,

Might you please advise if you have any updates on Webview+ and local storage?

At this moment it is not possible to use full power of Cocoon Webview+ mode.

Thank you,

Sergey


#6

Me too. My game is not saving/retrieving local data properly on iOS. I can’t publish my game till this gets fixed.

Any update @imanolm1 ? Please help.


#7

The same here, any news?..


#8

the performance on ios using webview+ is better than canves
Could you please fixed this problem?


#9

I solved the problem…if anyone want to know how…please contact me at forgoodgameshtml5@gmail.com
I can’t tell you here because it against the rules…


#10

Great to know. Why should it be against the rules to say how to fix an issue?

Regards
Andy


#11

I have the same problem can we get estimate when this will be fixed because its really a show stopper?


#12

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


#13

#14

Issue seems to be still unfixed. @Blue_Sialia can you check it, please? You will find a test case in my post above.

Thank you!


#15

Same issues as above. Android compiles and saves correctly but ios never saves to local storage no matter the changes to code.


#16

Bump! No production project on IOS can use webview+ and local storage! This is a huge problem. Do we have an update yet?


#17

@andoni.martin @imanolm1 can you check this bug? It’s a huge one…

Thank you!

Regards
Andy


#18

This has been added since July and yet not one post back detailing how or when they are planning to do to fix this. This is unacceptable. If this were a feature request i would understand, but a bug dealing with saving any persistent data seems important.


#19

Sorry but we have tried to reproduce the error using the zip file that @andy_reitberger shared but we can’t seem to reproduce the error. Connecting from Safari to the device Webview I only see succeed logs and everything seems to be working fine. If I wait till the big square goes pink, I can see in the console logs:

[Log] SaveGame: save triggered (c2runtime.js, line 15534)
[Log] Saved state to WebStorage (1144 bytes) (c2runtime.js, line 24)
[Log] SaveGame: save succeeded (c2runtime.js, line 15534)

If I click on the small green square while the big one is blue, I see:

[Log] SaveGame: load (c2runtime.js, line 15534)
[Log] Loaded state from WebStorage (1144 bytes) (c2runtime.js, line 24)
[Log] SaveGame: load succeeded (c2runtime.js, line 15534)

So when is the error supposed to show up?


#20

Hi @imanolm1

did you use cocoon 2.0.0 or the beta?
Back then when I tried it, I used 2.0.0 and WebView+.
I’ll try it again back home.

Thank you!

Regards
Andy