Michael Luce
Posts: 0
Joined: Mon May 11, 2015 5:58 pm

Behaviour differences between web Tester and Appery app

Hi,

I have an application that has the first page as a blank page with some javascript on. The javascript is;

Code: Select all

 var previouslyOpened = localStorage.getItem('Opened'); 

 if (previouslyOpened) { 
     Apperyio.navigateTo('Logon', {}); 
 } else { 
     Apperyio.navigateTo('Different_Page', {}); 
 }  

The Different_Page contains some agreements, and once these are viewed the user is directed to Logon. From then on, whenever the app starts I want them to go directly to Logon. The Logon page has the following javascript on load;

Code: Select all

 localStorage.setItem('Opened', true); 

This seems to work fine using the built in web Tester on Appery. On each load after the first load, they are directed to the Logon page.

This does not work when using the Appery.io iOS app to preview your app. What happens is that the blank start page loads, it successfully directs you to the Different_Page but then immediately navigates back to the blank start page.

There are no navigation elements on any other pages. I do not know why this is happening, but can only assume that the Appery.io preview app renders my app slightly differently.

Can anyone shed any light on this?

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Behaviour differences between web Tester and Appery app

Hello Michael,

Could you please check for the errors in a browser console when you test your app in a browser?

Michael Luce
Posts: 0
Joined: Mon May 11, 2015 5:58 pm

Behaviour differences between web Tester and Appery app

It works fine in the browser on PC. It is the Appery preview (iOS) app that displays the strange behaviour.

Michael Luce
Posts: 0
Joined: Mon May 11, 2015 5:58 pm

Behaviour differences between web Tester and Appery app

The javascript is currently on the Load event. If I change this to be on the 'Tap' event, and then tap the screen to run the javascript, it works fine.

EDIT: I have now changed it from Load to Page Show and it works as expected.

Return to “Issues”