[UWP]我可以在不通过App Service启动App的情况下更新Live Tile吗?

[UWP]我可以在不通过App Service启动App的情况下更新Live Tile吗?

问题描述:

大家好,

我们正在开发OEM预构建UWP应用程序,我们需要定期更新实时磁贴。即使用户尚未启动应用程序,也会发生这种情况。 

We are developing OEM pre-build UWP application, where we need to update the live tile at regular interval of time. This shall happen even if user hasn't launch application. 

我们尝试通过手动创建Live Tile并定期从后台任务更新来解决此问题。如果我们从另一个触发后台任务的应用程序启动我们的应用程序服我对
的这种行为进行了以下查询。

We tried to solve this problem by creating Live Tile manually and updating that from an background task at regular interval. This works fine if we launch our app service from another application which triggers background task. I have following queries on this behavior.

1。是否必须至少注册一次后台任务才能更新实时磁贴。或者有一个解决方案可以在安装应用程序后直接触发此更新(不启动它)。

1. Is it mandatory to register background task at least once to update the live tile. Or there is a solution to trigger this update directly after installing app (without launching it).

2。后台任务有默认时间间隔(TimeTrigger)是15分钟,有没有办法自定义这个间隔?

2. Background Task has default time interval (TimeTrigger) is 15 min, Is there any way to customize this interval?

你好Aqi Mirza,

Hi Aqi Mirza,

1。是否必须至少注册一次后台任务才能更新实时磁贴。或者有一个解决方案可以在安装app
后直接触发此更新(不启动它)。

当我们使用后台任务时,我们必须至少注册一次,如果你多注册它,它会在触发时执行更多。所以没有解决方案在安装应用程序后直接触发更新(不启动它)。

When we use the background tasks, we must register it at least once, and if you register it more, it will execute more when triggered. So that there is no a solution to trigger update directly after installing app(without launching it).

2。后台任务有默认时间间隔(TimeTrigger)是15分钟,有没有办法自定义这个间隔?

如果你使用
TimeTrigger 类,你只能设置间隔超过15分钟(包括15分钟)。如果您将间隔设置为小于15分钟,则在尝试注册后台任务时会抛出异常。

If you use the TimeTrigger class, you can only set the interval more than 15 minutes (including 15 minutes). And if you set the interval less than 15 minutes, an exception is thrown when attempting to register the background task.