Forum Discussion
max_desplanches
6 years agoHonored Guest
Unity OnApplicationQuit() call when closing app
Hi, I need to send a message to a server when my oculus Quest app is closed. In OnApplicationQuit(), I'm calling my function to send a message to the server but it appeared that the server never ...
Kev1970
6 years agoExplorer
I dont think onaplicationquit ever gets called.
Onapplicationpaused is called but not in all cases (like the user just taking the headset off, although perhaps after 10 seconds it may be, by which time they may have turned the device off).
You can check in update to see if the user is still wearing the headset and if theyre not then take action in case they end up quitting. Do the same for the pause state and you should be covered for all scenarios of users quitting your application.
Just honouring onapplicationquit would have been much easier and more intuitive of course.
Onapplicationpaused is called but not in all cases (like the user just taking the headset off, although perhaps after 10 seconds it may be, by which time they may have turned the device off).
You can check in update to see if the user is still wearing the headset and if theyre not then take action in case they end up quitting. Do the same for the pause state and you should be covered for all scenarios of users quitting your application.
Just honouring onapplicationquit would have been much easier and more intuitive of course.
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 1 year ago
- 10 months ago