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 a Toast Notification

Toast notifications require an XML envelope for the notification information. Listing 15.1 demonstrates how the creation of an XML envelope is constructed and sent to the MPNS. An HttpWebRequest is created using the push notification subscription URL. The notification XML is converted to a byte array, and then it is written to the outgoing request Stream. After sending the request, the response is examined to ensure that it was correctly received by the MPNS.

Note

For more information on the X-NotificationClass request header, and setting a notification’s priority level, see the upcoming section “Notification Classes.”

LISTING 15.1. PushNotifier Class (excerpt)

public PushNotificationSendResult ...

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