Search Unity

UnityWebRequest not aborted when closing application in Oculus Go

Discussion in 'Connected Games' started by F-R-O-S-T-Y, Jun 10, 2019.

  1. F-R-O-S-T-Y

    F-R-O-S-T-Y

    Joined:
    Mar 22, 2013
    Posts:
    191
    Hi,

    I have the removeFileOnAbort for the downloadHandler set to true. I've also setup events for OnApplicationQuit/OnDestroy/OnDisable. When these are called, the UnityWebRequest object is aborted and then disposed of.

    This works fine via the Editor. However, after building to Oculus Go and closing the app, the unfinished files are not deleted. I figured out that the exit events I mentioned above are not called when closing the app on Oculus Go. The nearest to what I need that is called is OnApplicationPause, however this does not help me. Not sure if this is also a problem on other Android devices.

    Any ideas on how to delete the ghost files once the application is exited(they are large in size)?

    Thanks!
     
    Last edited: Jun 10, 2019
  2. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    2,161
    Android applications in general should go to background and not quit. The system can terminate them on users request or to free resources.
    I don't think your scenario is a good choice. I think you should either resume your download on next launch (via ranged request) or continue to download even when in background (see https://github.com/Unity-Technologies/BackgroundDownload).
    Aborting the download and deleting lots of already downloaded data sounds like a waste of network bandwidth.
     
  3. F-R-O-S-T-Y

    F-R-O-S-T-Y

    Joined:
    Mar 22, 2013
    Posts:
    191
    "Should" does not mean it has to.The fact is that you can close android apps. And with Oculus Go, you have to close one application before starting a new one. So, adding a simple callback, which tells you an app has closed would be very handy. It is there for other platforms, why shouldn't it be there for Android?

    This would be awesome. Specially if I can control it, i.e resume only if certain conditions are met.

    What is this?

    This might not be acceptable in my case. I have to talk to my client about this.