Mobile Zone is brought to you in partnership with:

Jim is a Developer Evangelist for Microsoft who covers the Northeast District (namely, New England and upstate New York) focusing on Windows 8, Windows Phone, and cloud technologies. Jim is a DZone MVB and is not an employee of DZone and has posted 49 posts at DZone. You can read more from them at their website. View Full User Profile

Push Notifications via Windows Azure Web Sites: Part 1

11.19.2012
| 3197 views |
  • submit to reddit

If you haven't read my previous post on push notifications for Windows 8 applications, you may want to do so before continuing with the next few articles, which are a deeper dive into the development of a cloud service to support a specific Windows Store application. 

To provide a more concrete scenario, I’ve developed a Windows Store application called Boys of Summer (no, it’s not actually in the store… yet?). As you might gather from the title, it’s a baseball related app and provides information about the various Major League teams. Part of the functionality of the application is to keep you up-to-date on off-season team developments like trades, management changes, etc.  And, of course, push notifications are a great way to implement that.

The application interface appears below; notice that the group detail view includes a toggle switch the user can flip to be alerted for news regarding one or multiple teams.

Boys of Summer UI

As you might expect, the user’s interest in various teams is passed on to a Cloud Service that records the client’s URI as well as the team or teams which she is interested in tracking.

The other half of the equation is a Cloud Service along with some outside stimulus that triggers the notifications. In aprevious post, I’ve talked about Windows Azure Mobile Services which can greatly simplifies many push notification scenarios. Here though, I’d like to explore the implementation a bit closer to the metal, so I’m leveraging Windows Azure Web Sites, which (as of this writing) provides a free offering that is more than sufficient to support a Windows Store application like this. The resulting architecture (reusing the Windows Push Notification workflow from the MSDN documentation) is captured below.

Boys of Summer push notification architecture

My Windows Azure Web Site includes a user interface (the ASP.NET web page shown below) that enables an operator to trigger a notification to all subscribers to a given team. The notification then shows up as toast on the client’s machine. Going forward, the manual operation of entering the notification could be automated by pulling information off of a news feed, reformatting as needed, and finally triggering the notification.

Push notification experience

Published at DZone with permission of Jim O' Neil, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)