Page 1 of 1

localStorage persistance when app is closed?

Posted: Mon May 11, 2015 5:58 pm
by Michael Luce

Hi,

When my app opens I am checking for a localStorage variable that is set when opened (a boolean). The idea is to find out if this is the first time the user has opened the app. If I store a boolean using localStorage, will it persist the next time the app is opened (on iOS)?

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

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

Thanks for any advice!


localStorage persistance when app is closed?

Posted: Tue May 12, 2015 6:13 am
by Serhii Kulibaba

Hello Michael,

Your code is correct. You should just write true into localStorage variable on load event of 'Different_Page'


localStorage persistance when app is closed?

Posted: Thu May 14, 2015 9:56 am
by Michael Luce

This code does not seem to work correctly when using the appery app for viewing your own apps on the iPhone. Is this something to do with how it uses the browser?

It seems to work fine using the Appery Tester (web page).

The behaviour is;

This javascript is on the first app page and is a blank page. On Load the code runs, it navigates to the correct page but then immediately navigates back to the blank start page (with this code on).

There is nothing on the other pages in regard to navigation.


localStorage persistance when app is closed?

Posted: Thu May 14, 2015 12:02 pm
by Michael Luce

This doesn't work with the appery portal app (iOS). I have explained below.


localStorage persistance when app is closed?

Posted: Thu May 14, 2015 3:15 pm
by Evgene Karachevtsev

Michael,

Let's continue in one topic, if you don't mind:
https://getsatisfaction.com/apperyio/...