O'Reilly logo

Windows® Phone 8 Unleashed by Daniel Vaughan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sending Push Notifications

Sending a toast or tile push notification is done by creating an XML envelope containing the notification information, converting it to a byte array, and then sending it via an HttpWebRequest to the MPNS.

Note

When sending a push notification, only the HTTP POST method is allowed. Using any other method such as GET, PUT, CREATE, or DELETE results in a 405 MethodNotAllowed response. Moreover, a ProtocolViolationException results when writing to the request Stream.

For testing purposes, however, the HTTP GET method can be used, and results in a 200 OK response regardless.

An example of a push notification URL is http://sn1.notify.live.net/throttledthirdparty/01.00/AAGvdLTQzLGqRZ0FRZRVT1GBAgoOs1kPAQAAAAQOMDAwAAAAAAAAAAAAAAA ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required