Skip to content

Instantly share code, notes, and snippets.

@bendiksolheim
Created April 11, 2012 09:18
Show Gist options
  • Save bendiksolheim/2358198 to your computer and use it in GitHub Desktop.
Save bendiksolheim/2358198 to your computer and use it in GitHub Desktop.
public void GetPushUri()
{
Channel = HttpNotificationChannel.Find(CHANNEL_NAME);
if (Channel != null)
{
System.Diagnostics.Debug.WriteLine("Channel URI: " + Channel.ChannelUri.ToString());
}
else
{
Channel = new HttpNotificationChannel(CHANNEL_NAME);
Channel.HttpNotificationReceived += new EventHandler<HttpNotificationEventArgs>(HttpNotificationReceived);
Channel.ShellToastNotificationReceived += new EventHandler<NotificationEventArgs>(ShellToastNotificationReceived);
Channel.ChannelUriUpdated += new EventHandler<NotificationChannelUriEventArgs>(ChannelUriUpdated);
Channel.ConnectionStatusChanged += new EventHandler<NotificationChannelConnectionEventArgs>(ConnectionStatusChanged);
Channel.ErrorOccurred += new EventHandler<NotificationChannelErrorEventArgs>(ErrorOccured);
Channel.Open();
System.Diagnostics.Debug.WriteLine("Trying to open HttpNotificationChannel");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment