Hello,
Welcome to Microsoft Q&A!
I'm just talking from the UWP side, generally, UWP app will enter the suspended state when user minimized the app. You will have a very short time before the app get suspended.
But now there is a way that could make UWP app continue to run when it is minimized. You just need to use the extended execution APIs and add a restricted capability -extendedExecutionUnconstrained.
The code looks like this:
var newSession = new ExtendedExecutionForegroundSession();
newSession.Reason = ExtendedExecutionForegroundReason.Unconstrained;
newSession.Description = "Long Running Processing";
newSession.Revoked += SessionRevoked;
ExtendedExecutionForegroundResult result = await newSession.RequestExtensionAsync();
switch (result)
{
case ExtendedExecutionForegroundResult.Allowed:
DoLongRunningWork();
break;
default:
case ExtendedExecutionForegroundResult.Denied:
DoShortRunningWork();
break;
}
Please refer to Run in the background indefinitely for more detailed information.
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.