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 Raw Notification

Sending a raw notification differs from sending tile and toast notifications in that there is greater flexibility over the contents of the body of the notification.

Listing 15.3 demonstrates sending an object as part of a raw notification, using a DataContractJsonSerializer. As with tile and toast notifications, we create an HttpWebRequest, convert the content to a byte array, and then write it to the request Stream. Finally, we verify that the notification was correctly received by the MPNS.

LISTING 15.3. PushNotifier Class (excerpt)—Sending a Raw Notification

public PushNotificationSendResult SendRawNotification(    object content, string url, PushNotificationPriority priority){     ...

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