我正在尝试检测新安装的应用程序的首次启动并显示该应用程序的许可协议(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/