IPhone - first call detection by phone call

I am trying to detect the first launch of a newly installed application and display the license agreement for the application. The user must accept the lens or leave a request.

Does anyone know how I can do this using Phonegap? I was browsing through the threads, but it seems like I haven't found this anywhere.

thank

+5
source share
2 answers

You can use local storage to track the number of application launches.

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
}
+16
source

IOS can now clear localStorage, so you cannot count on its persistence.

For truly permanent storage, one option would be a file system plugin

https://cordova.apache.org/docs/en/latest/reference/cordova-plugin-file

, APP , , , . , , .

+1

All Articles