Save Data to Server While Application Is Closing in Unity3d

0 votes

I cannot save something to server at the time of application closing inside unity3d. This produces many problem in my game and everytime I try to find another ways to solve the problem. I wonder is it possible to save something on other platforms for example native android,cocos3d or xamarin etc? How can we overcome this problem inside unity?


asked Dec 19, 2016 in Unity by gokhan (20 points)

1 Answer

0 votes

Hello Gokhan,

We can do it on native iOS and Android as the platform provides some time to save data before sending Application in the background mode but the same thing is not possible in case of force close. In Unity, the MonoBehaviour class have some APIs like OnApplicationPause / Quit which you can use. But it may behave differently on different platforms.

You can also post this query to Unity Community to get more idea to solve this problem. I would recommend you to cache the data and send it to server immediately after you have this data instead of waiting for application close.

Let me know if you have any further queries, I will be happy to help you.



answered Dec 19, 2016 by rajeev.etc (1,660 points)
My Friend
Thanks for your answer. It is not something I can cache and send it immediately. For instance, I want to call DisconnectServer() api of appwarp while application is closing but I cannot.
Download Widgets
Welcome to ShepHertz Product line forum, where you can ask questions and receive answers from the community. You can also reach out to us on