我正在尝试检测首次启动新安装的应用程序并显示该应用程序的许可协议(protocol)。用户必须接受熏香或离开应用程序。
有谁知道我该如何使用Phonegap做到这一点?我已经搜索了所有主题,但似乎无法在任何地方找到它。
谢谢你
最佳答案
您可以使用本地存储来跟踪应用启动计数。
var applaunchCount = window.localStorage.getItem('launchCount');
//Check if it already exists or not
if(applaunchCount){
//This is a second time launch, and count = applaunchCount
}else{
//Local storage is not set, hence first time launch. set the local storage item
window.localStorage.setItem('launchCount',1);
//Do the other stuff related to first time launch
}
关于iPhone-使用phonegap检测首次启动,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14988264/