I made an extremely simple test scene with a button that calls Application.CaptureScreenshot(“test.png”). On the computer this works fine: it saves a screenshot called test.png to the root of the program. However, on iOS the file doesn’t exist anywhere on the device (tried a full file search on it). The API doesn’t say, but apparently it’s supposed to save to the devices Documents folder:
Using the devices built-in screenshot shortcut works fine (home+power button).
I’ve tried 2 different iPads and it doesn’t work on either.
EDIT: I discovered there’s actually more than one documents folder (one for the iPad and then one per app), but neither contains the screenshots. I also discovered that the search function I’ve been using in iExplorerer doesn’t work properly so the screenshots might be saving somewhere that I can’t find. Any suggestions?
Hello, I am facing the same issue, meaning, I am using the Application.CaptureScreenshot method passing a filename with fileformat as an argument (e.g. “someScreenshot.png”) as instructed in the documentation- and indeed, this works fine in the Unity Editor and creates an image in the Application.persistentPath directory, which in this case is C:\Users\userName\AppData\LocalLow\CompanyName\ProductName. Btw, this works fine even if I pass the fullFilePath as an argument, e.g. smth like System.IO.Path.Combine(Application.persistentDataPath, fileName), which replies to the previous posts.
My issue, is that likewise with @PsychoDuckArcade this doesn’t seem to work on iOS. I have added the key UIFileSharingEnabled in the info.plist file (iOS Keys) and indeed, when the user connects their iPad to iTunes they can see and save other file types that the app exports, such as txts, but not the screenshot pngs. I also assigned the mentioned script to a GameObject that stays always open in the scene, in case it takes so much longer for the image creation process in the iPad that it might get interrupted by other user actions (since the method doesn’t return a Task whose completion I can check easily). No progress.