At MIX11 we released the Windows Azure Toolkit for Windows Phone 7 v1.1.0, which included out-of-the-box support for the Microsoft Push Notification Service (MPNS) for Windows Phone. The MPNS provides an efficient way for an application to register itself for updates that are pushed directly to the phone rather than writing the application to frequently poll a web service to look for pending notifications. This has the benefit of reducing the impact on your phone battery, as polling results in the device radio turning on frequently.
When using the MPNS you need to setup your own web service that notifies Microsoft to send the notification. It’s your responsibility to setup this service – you have to create the notification channel, bind it to the correct type of notification, and ultimately host the web service. The Windows Azure Toolkit for Windows Phone 7 makes it really easy to not only host your web service in Windows Azure but also create the channel and setup the correct notification binding (largely thanks to the Windows Push Notification Service Side Helper Library from Yochay Kiriaty).
Once you start up the application, the first thing you’ll want to do is enable push notifications. To do this, check the box on the initial page to create the channel.
Once this has successfully registered, head over to the website and log in as the administrator. There’s now a Push Notifications tab where you’ll see your user registered:
From here you can the the push notification channel by sending all three push types: toast, tile, and raw. In that order, here’s what you’ll see (note: to see the tile message you must first pin the app to start):
Not bad for an out-of-the-box experience requiring ZERO updates!
To learn more about this version of the toolkit – or to see it live and in action – take a look at the session I presented at MIX11 entitled Building Windows Phone 7 Applications with the Windows Azure Platform.
Hope this helps!comments powered by Disqus