0

In my winrt app, I am trying to update the live tile based on polled URIs. There is currently no update happening and I can't figure out how to troubleshoot. There are numerous scenarios that could be breaking things but i can't seem to find anyway to get insight into potential errors.

The TileUpdateManager seems to be a bit of a black hole that absorbs information but never lets it out.

Does anyone know of how to view errors from the TileUpdateManager?

If it interests anyone, here is my update code:

TileUpdateManager.CreateTileUpdaterForApplication().EnableNotificationQueue(true);

PeriodicUpdateRecurrence recurrence = PeriodicUpdateRecurrence.HalfHour;
List<Uri> urisToPoll = new List<Uri>();
urisToPoll.Add(new Uri(@"http://livetileservice2012.azurewebsites.net/api/liveupdate/1"));
urisToPoll.Add(new Uri(@"http://livetileservice2012.azurewebsites.net/api/liveupdate/2"));
TileUpdateManager.CreateTileUpdaterForApplication().StartPeriodicUpdateBatch(urisToPoll, recurrence);
yamspog
  • 18,173
  • 17
  • 63
  • 95
  • The content served by the provided URIs doesn't appear to be valid tile notification XML. In some browsers, the element contains text ("<binding template="TileWideText09"> ...") instead of elements. In IE, the content appears to be JSON. – Nathan Kuchta Nov 28 '12 at 00:01
  • the webservice will return json or xml based on the accept header. In IE, the default is a JSON request. If you try Chrome, where the default is XML, you get xml response. However, you make a good point, that perhaps the TileManager is not setting this and JSON becomes the default format returned. – yamspog Nov 28 '12 at 19:31

1 Answers1

1

To expand on Nathan's comment, here are two steps you can take to troubleshoot:

  1. Enter your URI straight into a browser to see the results that are returned, and inspect them for being proper XML. As Nathan points out, your URIs are returning JSON which will be ignored by the tile update manager. As a working example (that I use in Chapter 13 of my HTML/JS book), try http://programmingwin8-js-ch13-hellotiles.azurewebsites.net/Default.cshtml.

  2. If you feel that your URI is returning proper XML, try it in the Push and Periodic Notifications Sample (Scenarios 4 and 5 for tiles and badges). If this works, then the error would be in your app code and not in the service.

Do note that StartPeriodicUpdate[Batch] will send a request to the service right away, rather than waiting for the first interval to pass.

Also, if you think that you might have a problem with the service, it's possible to step through its code using Visual Studio Express for Web running on the localhost, when the app is also running inside Visual Studio Express for Win8 (where localhost is enabled).

.Kraig

  • MSDN also has some troubleshooting tips: http://msdn.microsoft.com/en-us/library/windows/apps/hh465403.aspx#troubleshooting_tiles – Nathan Kuchta Nov 28 '12 at 03:22
  • as you indicated, the webservice is returning invalid XML. checking against your XML confirmed that my app code is working fine. Also hearing that the StartPeriodicUpdate makes a call immediately is very helpful. Now I've got fix up my serializers and i'll be off to the races. – yamspog Nov 28 '12 at 19:45