javascript - Ionic run function before app closes -


is there kind of function can call listens whether app exit, or close or go background.. event means "the user has stopped using app"?

i'm app build 'user log' tracks user navigating through app. instead of sending little pieces of data server these events occur, want send off whole batch in 1 go before user stops using app (again, whether means closing app completely, sending background etc.)

and lastly, if such function indeed exist.. put function? in app.js? or have put listener in every single controller of app?

you can check events list cordova docs:

https://cordova.apache.org/docs/en/5.4.0/cordova/events/events.html

in particular pause event:

the event fires when application put background.

document.addeventlistener("pause", yourcallbackfunction, false);


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -