Search code examples
javascriptcordovacordova-3

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.


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