microsoft / DesktopBridgeToUWP-Samples

This repo contains the samples that demonstrate the usage patterns for the Desktop Conversion extensions.
MIT License
495 stars 271 forks source link

Start UWP background task without launching App even single time #101

Open rahulsbaviskar opened 3 years ago

rahulsbaviskar commented 3 years ago

I have a WPF app which is deployed as a store app using desktop bridge approach. I want to create a UWP time triggered background task to do some work in a background even though my app is not launched by user. I want to know is there any way to register and trigger background task without launching the app. Any help will be appreciated. Thanks.

myokeeh commented 3 years ago

This would be good to have. I've been depending on the on "on update" trigger since it's the closest thing I could find.

vichuviswan commented 3 years ago

@rahulsbaviskar You could use the PreInstall task to register the time trigger background task and you may do the routine work as part of the handler for the time trigger background task.

However, if you don't want to do the operation repeatedly, instead just want to do some operation only once, you could write the logic directly in the handler of the Preinstall task.

Hope this works.