Search code examples
androidiostitaniumtitanium-mobiletitanium-alloy

Identify whether the app is installed for the first time using Titanium


I am working on a cross platform app using Titanium Appcelerator.

I want my app to find out if the application is installed for the first time on that particular device.

How can I do it using Ti.App.Properties?

Can anyone tell how can I do this?

Thanks in advance!


Solution

  • Yes, e.g.:

    if( !Titanium.App.Properties.hasProperty( 'firstTime' ) ) {           
            // set the property for next time
            Ti.App.Properties.setBool( 'firstTime' , false );
            // do something
    }
    

    The properties will be wiped if the user uninstalled the application.