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
Post a Comment