问题
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
. 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.
As stated I am using JavaScript throughout, not C#.
Is this possible?
回答1:
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.
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.
来源:https://stackoverflow.com/questions/14709338/local-push-notification-to-win8-live-tile-running-js-code-inside-app