Checking first time app launch using Cordova 3.0

cordova, cordova-3, javascript

Solution

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');
}

Problem

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.

Original source