Timetrigger not firing backgroundtask UWP

后端 未结 2 1345
忘掉有多难
忘掉有多难 2020-12-21 11:47

I have the same problem as this guy over here: UWP Timetrigger not working but I can\'t comment the question because my reputation is not high enough, so I\'m creating a new

2条回答
  •  独厮守ぢ
    2020-12-21 12:46

    1. You can confirm that the your task is registered or not by using powershell. Open powershell with administrative rights, and run 'Get-AppBackgroundTask'. All of registered tasks are listed. If you can't find your task from the list, there are some problems at registration.

    2. Have you add the background task project as a reference to your main app?

    3. Have you call the BackgroundExecutionManager.RequestAccessAsync()? You should call it before registering, from UI thread.

    1. I have a sample app of background task with timetrigger on the store. It's hidden from storefront and search, but you can download it from following link:

    https://www.microsoft.com/store/p/ddlgbgtasktrial/9nblggh4s785

    This app regist a simple background task with 15min interval timetrigger. This task just output the debugmessage to the logfile. The app shows a log. If it works well, you can see the debug output with about 15min intervals.

    I've confirmed that the app works with Win10 desktop 10586.494 and mobile 14393.0.

提交回复
热议问题