I've got a windows store app, and I'm setting it up to periodically update the tile. Originally, I set it to use StartPeriodicUpdate(Uri, PeriodicUpdateRecurrence)
but it didn't seem to be updating, and because the minimum recurrence is HalfHour, I wanted to use StartPeriodicUpdate(Uri, DateTime, PeriodicUpdateRecurrence)
, and set the startTime to DateTimeOffset.Now.AddMinutes(5)
so that it would wait 5 minutes before updating, to make testing easier. Code:
public void UpdateLiveTile()
{
LiveTileUpdater.Clear();
var uri = TILE_UPDATE_URI; // example
var start = DateTimeOffset.Now.AddMinutes(5);
LiveTileUpdater.StartPeriodicUpdate(uri, start, PeriodicUpdateRecurrence.HalfHour);
}
However, when I run this, the tile updates immediately, instead of updating 5 minutes from when it's called. I would think that calling the override without the startDate parameter would run immediately (it does) and then the other would run after 5 minutes. Does anyone know why it updates right away, or how I can make sure it's delayed?
Edit: Additionally, if anyone knows why the periodic update isn't occurring either, that would be a great help. The server is definitely responding correctly, because the first update works great, but it never changes. Documentation indicates that the start time and periodic interval could both be delayed by up to 15 minutes, but it's way beyond that margin of error, and I'm not getting any updates.
I found the answer on this page (bold is my emphasis):
When you call one of those methods, the URI specified in the call is immediately polled and the tile or badge is updated with the received contents. After this initial poll, Windows continues to provide updates at the requested interval. Polling continues until you explicitly stop it...
I think the reason that the 5 minute refresh wasn't working, then, is that it polls immediately, and then won't poll again sooner than the interval (30 Minutes), but that it would refresh 30 minutes from then instead of now. This last part is speculation, but the above paragraph indicates why it was updating immediately.
For the second part, it looks like it was updating (when I ran on localhost with a breakpoint, the breakpoint was eventually hit and it refreshed the tile), I guess I just didn't wait long enough.