简体   繁体   English

在应用程序内部运行JS代码的Win8 Live Tile的本地推送通知

[英]Local push notification to Win8 Live Tile running JS code inside app

I am trying to send updates to my app's tile. 我正在尝试将更新发送到我的应用程序的磁贴。 This works fine when the app is running. 这在应用程序运行时工作正常。 I can, for example, easily send a tile update notification to the tile when the user clicks a button. 例如,当用户单击按钮时,我可以轻松地向磁贴发送磁贴更新通知。

What I can't work out is how to update the tile when the app isn't working. 我无法解决的是当应用程序不工作时如何更新磁贴。 The only option I have found for this is to poll (or push from) a remote webserver using REST on HTTP . 我找到的唯一选择是使用HTTP REST轮询(或推送)远程Web服务器。 This isn't ideal for me, and I cannot believe that is the only method of updating the tile. 这对我来说并不理想,我无法相信这是更新磁贴的唯一方法。

Ideal here would be to specify a local JS file that is to get run at any given interval, let's say 15 mins as per the Tile guidelines. 这里的理想选择是指定一个本地JS文件,它可以在任何给定的时间间隔内运行,比如根据Tile指南15分钟。

As stated I am using JavaScript throughout, not C#. 如上所述,我使用的是JavaScript,而不是C#。

Is this possible? 这可能吗?

You have a couple of choices. 你有几个选择。 You can implement a Background task for your application that can update the tile. 您可以为可以更新磁贴的应用程序实现后台任务。 See the Background Quickstart for info on getting started with that. 有关入门的信息,请参阅后台快速入门 Day 21 of GenerationApp also provides more info on working with background tasks. GenerationApp的第21天还提供了有关使用后台任务的更多信息。

Another option is to use Push Notifications. 另一种选择是使用推送通知。 You can read the overview of Push notifications and also checkout Azure Mobile Services for an easy way to provision notifications in the cloud. 您可以阅读推送通知概述,还可以查看Azure移动服务 ,以便在云中配置通知。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM