I make a library with several background tasks for UWP 8.1/10 (desktop/mobile).
I have 3 background tasks but I talk about one of them. When the app starts, I see permission request dialog:
await BackgroundExecutionManager.RequestAccessAsync();
I click to allow and continue registration of background task, this part works excellent. Every 15 minutes I see my task in Output. It works perfectly.
So, in near future, I want to change execution time while background task is working it creates the same task with another TimerTrigger
(depends on some conditions, but it can happen), for example:
- register again with the same time in
TimerTrigger
- register new
TimeTrigger
with one per two days timer.
I know about:
Note Universal Windows apps must call RequestAccessAsync before registering any of the background trigger types.
So, I need use await BackgroundExecutionManager.RequestAccessAsync()
every time when I try to register any of background task, does I understand it right?
In other words, I do it every time when I change/re-register TimerTrigger
for the first time, then when I need to do it when:
- register again with the same time in
TimerTrigger
or
- register new
TimeTrigger
with one per two days timer.
Can someone help me to understand? :)
P.S I saw somewhere that re-registration in UWP 10 is not necessary, is it?