Tuesday, September 17, 2013

Why my Win8 tiles weren't updating


I spend the vast amount of my development effort focusing on Windows Phone but also do some Windows 8 work.

Just recently I noticed that the live tile for an app wasn't updating to show the latest content.

The tile was updated with a TileUpdater instance and by watching the network traffic I could see that the requests for content were being sent and the server was returning a 200 response with what looked, at a quick glance, like valid content. After all the same code had been running for a year without issue.

Unfortunately, AFAIK, there is no error raised or recorded anywhere when invalid content is returned by the server. Despite this, as the only thing that had changed was the pay load of the notification so I started my investigation there.

Taking a proper look at what was happening and what might be going on, I quickly spotted a probable cause in the returned XML.

There was an unencoded ampersand in the text. 

Oh I feel foolish. Especially after I make such a fuss about developers who use but don't understand XML properly. :(

Anyway,  the lesson here is that you should ALWAYS make sure that your XML is encoded properly. Especially with regards tile information. If your tiles stop updating this is probably a good place to start looking. ;)


0 comments:

Post a Comment

I get a lot of comment spam :( - moderation may take a while.