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.
For more information on the
X-NotificationClass request header, and setting a notification’s priority level, see the upcoming section “Notification Classes.”
public PushNotificationSendResult ...