Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
Reddo's avatar
Reddo
Member
7 years ago

Oculus Go - Deleting file from persistentDataPath when UnityWebRequest abort

I'm trying to delete a file in Go's persistentDataPath directory if the download has been aborted on quitting the application
I've tried both OnApplicationQuit and OnDestroy methods which work fine in the Unity Editor and it's persistentDataPath. For example
public void OnDestroy()
    {
    if (FileExists == 0)
        {
            uwr.Abort();
            File.Delete(Application.persistentDataPath + "/" + videoFileName);
        }
   }
But when quitting the app on the Go, the partly downloaded file does not get removed. I've got Write Permisson set to external in Settings.
OnApplicationPause also deleted the file successfully when the Go is in pause mode. 
Just wondering if there's another method specifically for the Go and/or Android when quitting the application

Replies have been turned off for this discussion