2014-11-06 52 views
1

我正在使用Titanium Appcelerator开发跨平台应用程序。确定应用程序是否是第一次使用Titanium安装

我希望我的应用程序能够了解应用程序是否在该特定设备上首次安装。

我该如何使用Ti.App.Properties来做到这一点?

有谁能告诉我该怎么做?

在此先感谢!

回答

4

是的,例如:

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

如果用户卸载应用程序的性能都将灰飞烟灭。

+1

会好得多像'if(!Titanium.App.Properties.hasProperty('firstTime'))' – turtle 2014-11-06 10:53:32

+1

我知道必须有更好的方法,更新 – phil 2014-11-06 12:22:22

相关问题