我正在尝试检测新安装应用程序的首次启动,并显示应用程序的许可协议。用户必须接受许可协议或离开应用程序。
有人知道如何在Phonegap中实现这一点吗?我已经搜索了相关主题,但似乎没有找到任何相关的信息。
谢谢。
有人知道如何在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
}
https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file
请注意,如果您的应用被卸载,您的持久性文件很可能也会被删除。对于这个应用程序来说,这可能是可以接受的。