Subscribing to Push Notification

To subscribe to push notification within an app, we first attempt to retrieve an existing HttpNotificationChannel by name.

channel = HttpNotificationChannel.Find("<a channel name>");

The HttpNotificationChannel.Find method does not raise an Exception and returns null if the channel with the specified name is not found. If so, a new instance must be created.

The Push Notification sample in the downloadable code contains a class called PushNotificationSubscriber, which manages subscription to the MPNS by wrapping a notification channel. The main benefit of using a wrapper for the notification channel is that if the PushNotificationSubscriber instance is unable to perform the subscription to the MPNS, due to the ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.