Screenshot on ios don't show in IPad gallery

Hi ansonkit.

In the end we used a different solution. For some reason we did not have the time to understand, this solution did not work for the most recent versions of Unreal Engine and iOS.

What we ended doing is:

  1. We created a C++ class with a blueprint callable method that calls FScreenshotRequest::RequestScreenshot. This time we did not use a custom path, just a filename, “Image.png”, and we let Unreal save the screenshot on its default folder. As return from this method, we get the path, calling FScreenshotRequest::GetFilename, so we know where the screenshot is saved (“/YourProjectName/Saved/Screenshots/IOS/Image.png”).

  2. In this same class we created another blueprint callable method only to check if the screenshot is ready (it takes miliseconds, but it’s not instantly done). This can be done with FPaths::FileExists, using the path from the previous method.

  3. Then we created another blueprint callable method to call an Objective-C method. Well, that’s the tricky part, but that’s what worked for us. When we learned that is possible to mix Objective-C code inside the .cpp file, we decided to use a iOS native method to save the screenshot to the album. The method is UIImageWriteToSavedPhotosAlbum. It needs a UIImage as parameter and for that we created an UIImage with imageWithContentsOfFile, passing that path from step 1.

For this third step, you need to know how to call a native iOS method from a .cpp file. What helped us was this two links:

How to access iOS photo library / use Objective-C properly? - Plugins - Epic Developer Community Forums - we actually created our solution based on this one

Accessing iOS SDK possible? - Mobile - Epic Developer Community Forums - Michael Noland explanation

  1. Finally, back to Unreal Editor, we created an Actor with this class, put it in our map, created a reference to it on the level blueprint, and call the C++ methods from it.