在应用程序内部运行JS代码的Win8 Live Tile的本地推送通知 [英] Local push notification to Win8 Live Tile running JS code inside app

查看:112
本文介绍了在应用程序内部运行JS代码的Win8 Live Tile的本地推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试向我的应用的磁贴发送更新。这在应用程序运行时工作正常。例如,当用户点击按钮时,我可以轻松地向磁贴发送磁贴更新通知。

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.

我无法解决的是如何更新磁贴当应用程序不工作时。我找到的唯一选择是在 HTTP 上使用 REST 轮询(或推送)远程网络服务器。这对我来说并不理想,我无法相信这是更新磁贴的唯一方法。

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. This isn't ideal for me, and I cannot believe that is the only method of updating the tile.

这里理想的是指定一个本地JS文件在任何给定的时间间隔运行,比如Tile指南15分钟。

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.

如上所述,我使用的是JavaScript,而不是C#。

As stated I am using JavaScript throughout, not C#.

这可能吗?

推荐答案

您有几个选择。您可以为可以更新磁贴的应用程序实现后台任务。有关入门的信息,请参阅后台快速入门。 。 GenerationApp第21天还提供了有关使用后台任务的更多信息。

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.

另一种选择是使用推送通知。您可以阅读推送通知概述以及结帐 Azure移动服务,以便在云中配置通知的简便方法。

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.

这篇关于在应用程序内部运行JS代码的Win8 Live Tile的本地推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆