Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Checking first time app launch using Cordova 3.0

Is there a way in Cordova 3.0 to check if that's the first time the application runs without using the DB for that purpose.

like image 660
Idan Shechter Avatar asked Dec 03 '13 12:12

Idan Shechter


Video Answer


1 Answers

You could use localStorage to check for a variable. Try something like this:

in docummentready event:

if(window.localStorage.getItem('has_run') == '') {
    //do some stuff if has not loaded before
    window.localStorage.setItem('has_run', 'true');
}
like image 187
Dawson Loudon Avatar answered Oct 05 '22 03:10

Dawson Loudon