I need to take screenshot on Android phone during app running when users presses button. I have next function:
#include "MyUserWidgetBlueprint.h"
#include "Misc/Paths.h"
#include "Misc/FileHelper.h"
FString UMyUserWidgetBlueprint::CustomRequestScreenshot(FString FileNameSC, bool UIRendered, bool FNSuffix)
{
FString SavePath = FPaths::ProjectPersistentDownloadDir();
FString FullScreenshotPath = FPaths::Combine(SavePath, FileNameSC);
FScreenshotRequest::RequestScreenshot(FullScreenshotPath, UIRendered, FNSuffix);
UE_LOG(LogTemp, Warning, TEXT("Screenshot request sent to: %s"), *FullScreenshotPath);
return FullScreenshotPath;
}
It works perfectly on my Android 14 phone if I deploy build with “Development” flag, but when I am using “Shipment” flag it does not work - screen shot is not saving.
Was it changed ? Before I’ve migrated my project from UE 5.3 to UE 5.5.1 and from Android 11 to Android 14 it was working. I know that there is change in Android (starting from 14 version) which restrict access to file system, but I tried to save screen shots even to the SaveGame folder where apps saves game progress easily(save games are saved correctly). But when it comes to screen shots - it does not work.
RequestScreenshot does not work anymore for Shipment ? Is there anyway to fix that ? Please explain.