Search code examples
winjswindows-10-universal

WinJs background application


I am working on creating a Windows 10 Universal app. My goal is to have the app run in the background and periodically display a status notification to the user.

I've seen a few articles that talk about creating a background task within the app (https://msdn.microsoft.com/en-us/windows/uwp/launch-resume/run-a-background-task-on-a-timer-), is this the best design pattern I can follow? I'm fairly new to Windows Universal apps and any recommendations on how to do this would be appreciated.


Solution

  • Look at the IBackgroundTask docs. In addition, you can easily implement notifications via the OS with Adaptive Toasts

    Since the story around notifications can get complex depending on how you want to control UX, don't be afraid to research building an RT component if you can't find a UWP API that meets your needs. For instance, you can package an RT component with your UWP app that calls into native C++ libraries or more low-level Windows APIs to curate the notification experience for your user.