While the MSDN has plenty of documentation on what Windows Phone 7 Push Notifications are, what they do, and how they work, they didn’t have much in terms of how to set up a web service for Push Notifications. I found an awesome tutorial here…http://benjii.me/2011/01/push-notifications-in-windows-phone-7-2-code-on-the-server/. It’s a 3 part series that shows everything from building your web service, registering your phone with the web service, and sending push notifications to Microsoft’s Push Notification system from your web service. The only thing missing from the posts is the few lines of code needed to enable the usage of web images as background tiles. Here’s that block of code….
if (!httpChannel.IsShellTileBound) { var c = new System.Collections.ObjectModel.Collection<Uri>(); c.Add(newUri("http://0.tqn.com/")); httpChannel.BindToShellTile(c); }
To enable external images, create a collection of Uri’s and add each domain that will be hosting an external image that you want to use (domain names are limited to 256 characters). Then, pass the collection to the BindToShellTile method on your http channel. The server side code for updating the tile is in part 3 of the blog post mentioned above.