Alex
Alex

Reputation: 577

How to distinct "pause" and "shutdown" event with PhoneGap

I'm developing a PhoneGap app who is retrieving values from a distant server.

When my app is going to be paused, it goes to the background and stop getting datas, but keep errors tracked when listening. All is okay.

My question is how to detect "shut down" event with PhoneGap, because I want to do other stuffs when my app is shutting down than when it's pausing.

In other words, I can do document.addEventListener('pause', this.onDevicePause, false); and I wonder to know if a sort of document.addEventListener('unload', this.onDeviceUnload, false); exists.

Thanks for your help. Best regards

Upvotes: 1

Views: 906

Answers (1)

Alex
Alex

Reputation: 577

Provided by this link, I think that even if I can get a sort of "ondestroy" event, it would probably not work because the app is killed.

Handle onDestroy method in javascript

I think I will play with the "pause" event and some imaginary stuffs ;-)

Upvotes: 1

Related Questions