Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Execute script when install and uninstall cordova app using ionic

For Some years I'm working with cordova and less than 1 year with ionic.

I'm looking for the way to run a JavaScript function when the app is being installed and when is being uninstalled.

I have done many searches but have not found anything about it, someone has an idea, at least an approximation to serve as a starting point?

Thank you so much.

like image 717
cmarrero01 Avatar asked Mar 01 '16 11:03

cmarrero01


1 Answers

I suggest to check these posts:

  • Detect uninstall event in phonegap app
  • iPhone - detect first time launch with phonegap

However I think it's really difficult to raise an "uninstall event" (eventually by a Cordova plugin) which can be listened by your JS code.

Instead it's easier to check first time the app is launched using localStorage as suggestend in the 2nd post.

like image 86
beaver Avatar answered Sep 28 '22 13:09

beaver