Skip to content

Commit

Permalink
Windows8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Redth committed Sep 19, 2012
1 parent 02a790d commit 543da29
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion PushSharp.Windows/WindowsPushChannel.cs
Expand Up @@ -59,6 +59,15 @@ void RenewAccessToken()
} }


protected override void SendNotification(Common.Notification notification) protected override void SendNotification(Common.Notification notification)
{
try { sendNotification(notification); }
catch (Exception ex)
{
this.Events.RaiseChannelException(ex, PlatformType.Windows, notification);
}
}

void sendNotification(Common.Notification notification)
{ {
//See if we need an access token //See if we need an access token
if (string.IsNullOrEmpty(AccessToken)) if (string.IsNullOrEmpty(AccessToken))
Expand Down Expand Up @@ -87,7 +96,7 @@ protected override void SendNotification(Common.Notification notification)
break; break;
} }


var request = (HttpWebRequest)HttpWebRequest.Create("https://cloud.notify.windows.com"); var request = (HttpWebRequest)HttpWebRequest.Create(winNotification.ChannelUri); // "https://notify.windows.com");
request.Method = "POST"; request.Method = "POST";
request.Headers.Add("X-WNS-Type", wnsType); request.Headers.Add("X-WNS-Type", wnsType);
request.Headers.Add("Authorization", string.Format("Bearer {0}", this.AccessToken)); request.Headers.Add("Authorization", string.Format("Bearer {0}", this.AccessToken));
Expand Down

0 comments on commit 543da29

Please sign in to comment.