LocalStorage not working on iOS

Bugs will be moved here once resolved.

Post » Mon Mar 06, 2017 6:05 pm

Problem Description
____ I built a game for iOS. I tested it on iPhone 6s, iPhone 7 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.

I used the same events for android, there it is working fine. I'm not sure where it went wrong for iOS. The game doesn't contain any third party plugins even. At first I built the game for android after resolving all the bugs I built it for iOS. Everything is fine and smooth on android but I'm facing problems with iOS.

All the devices are running on 10.2.1 version.
____

Attach a Capx
____ https://drive.google.com/file/d/0B9wfZG ... VYZWM/view ____

Description of Capx
____ The Capx consists of a two videos, 20 levels, instruction screens with localstorage assigned to store values for score, stars and check whether video is played for the first time. It consists of basic events, which are same for all the remaining levels (whole project). All the values are retrieved from the localstorage and assigned to global variables on the MainMenuScreen event. All the events work based on the values of global variables.____

Steps to Reproduce Bug
  • Step 1 - This should be tested on an Apple device (iPad or iPhone).
  • Step 2 - Run the game and try few levels in Green Leafy Planet. All the values will be saved to the localstorage at end of every layout.
  • Step 3 - Once the game is run through few levels, close and reopen the game.
  • Step 4- Once again repeat step 2.

Observed Result
____ Once you run Step 4, the game will starts without the first video then will go to the MainMenu screen and check the stars on left-top of the screen, you will not get any stars that are collected in the previous session. Then go to planets selection screen by clicking play. When click on Green Leafy planet, you will find all the instruction screens appearing just as in the previous session. Then when you select a level, you will find all the instruction screens appearing just as in the previous session.____

Expected Result
____ Once you run Step 4, you should not get any videos or instruction screens appearing. The game should start without the first video then should go to the MainMenu screen and should retrieve stars collected in the previous session. Then go to planets selection screen by clicking play. When you click on Green Leafy planet, you should directly go to the Map screen without any instruction screens. Then when you select a level it should go directly to a level without any instruction screens. ____

Affected Browsers
  • Chrome: (NO)
  • FireFox: (NO)
  • Internet Explorer: (NO)

Operating System and Service Pack
____ Windows 10 ____

Construct 2 Version ID
____ Construct 2 r239 ____
B
24
S
7
Posts: 335
Reputation: 2,220

Post » Mon Mar 13, 2017 3:39 pm

Hi,
Did anyone get a chance to look into the issue. I'm very close to release the game. I'm just waiting for the iOS build to work. Any update would be appreciated. :)

Thanks,
Sudeep
B
24
S
7
Posts: 335
Reputation: 2,220

Post » Tue Mar 14, 2017 10:37 am

This issue seems to be caused by the WebView + plugin CocoonIO is using.
If you switch to Canvas+ as webview engine it's working fine.

Regards
Andy
Image Image iTunes: Match3 | Google Play: Match3
B
98
S
33
G
30
Posts: 1,121
Reputation: 27,799

Post » Tue Mar 14, 2017 1:10 pm

AndreasR wrote:This issue seems to be caused by the WebView + plugin CocoonIO is using.
If you switch to Canvas+ as webview engine it's working fine.

Regards
Andy


Hey thanks for the response. I'm using Intel XDK not CocoonIO. Do I need to do anything in Intel XDK?
B
24
S
7
Posts: 335
Reputation: 2,220

Post » Wed Mar 15, 2017 10:33 am

Intel XDK is also using a WebView plugin.
So maybe it's a basically issue of WebView.

Regards
Andy
Image Image iTunes: Match3 | Google Play: Match3
B
98
S
33
G
30
Posts: 1,121
Reputation: 27,799

Post » Wed Mar 15, 2017 10:56 am

AndreasR wrote:Intel XDK is also using a WebView plugin.
So maybe it's a basically issue of WebView.

Regards
Andy


Oh okay. I will install that plugin, build the app and reinstall it on a mobile device. I will let you know the output. Thanks. :)
B
24
S
7
Posts: 335
Reputation: 2,220

Post » Sun Apr 02, 2017 7:11 pm

@AndreasR
Hi, I tested the app again. I app already contains Cordova WKWebView Engine. Still the problem exists. Do you suggest me something else?
B
24
S
7
Posts: 335
Reputation: 2,220

Post » Wed Apr 05, 2017 7:39 pm

Did anyone get a chance to look into the issue?
@sudeep98 any solution ?
B
30
S
14
G
2
Posts: 28
Reputation: 3,341

Post » Mon Apr 10, 2017 6:59 am

@brandonP No solution so far. Do you face the same issue?
B
24
S
7
Posts: 335
Reputation: 2,220

Post » Tue Apr 11, 2017 12:09 am

@sudeep98 not yet I'm studying my options so far construct 2 seems to be solid but for mobile dev not sure...
But there might be a solution using the system-->save and load as it saves directly on the hard drive. ( if somebody could confirm this approach)
local and webstorage are considered volatile data by iso10 ... iOS clears cordova localStorage at random
an other solution would be to use cordova-plugin-nativestorage
https://github.com/TheCocoaProject/cordova-plugin-nativestorage
B
30
S
14
G
2
Posts: 28
Reputation: 3,341

Next

Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 3 guests