Skip to content

Commit

Permalink
Merge pull request Redth#760 from elvis512/master
Browse files Browse the repository at this point in the history
Add support for Toast notifications
  • Loading branch information
Redth authored Dec 1, 2016
2 parents c2fa068 + 5c711b6 commit a0dc0ac
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion PushSharp.Windows/WnsConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ public async Task Send (WnsNotification notification)
if (winTileBadge != null && winTileBadge.CachePolicy.HasValue)
http.DefaultRequestHeaders.Add("X-WNS-Cache-Policy", winTileBadge.CachePolicy == WnsNotificationCachePolicyType.Cache ? "cache" : "no-cache");
}
else if(notification.Type == WnsNotificationType.Toast)
{
http.DefaultRequestHeaders.TryAddWithoutValidation("X-WindowsPhone-Target", notification.Type.ToString().ToLower());
}

HttpContent content = null;

Expand Down Expand Up @@ -165,7 +169,7 @@ WnsNotificationStatus ParseStatus(HttpResponseMessage resp, WnsNotification noti
var wnsDeviceConnectionStatus = TryGetHeaderValue (resp.Headers, "X-WNS-DEVICECONNECTIONSTATUS") ?? "connected";
var wnsErrorDescription = TryGetHeaderValue (resp.Headers, "X-WNS-ERROR-DESCRIPTION") ?? "";
var wnsMsgId = TryGetHeaderValue (resp.Headers, "X-WNS-MSG-ID");
var wnsNotificationStatus = TryGetHeaderValue (resp.Headers, "X-WNS-NOTIFICATIONSTATUS") ?? "";
var wnsNotificationStatus = TryGetHeaderValue (resp.Headers, "X-WNS-NOTIFICATIONSTATUS") ?? TryGetHeaderValue(resp.Headers, "X-NOTIFICATIONSTATUS") ?? "" ;

result.DebugTrace = wnsDebugTrace;
result.ErrorDescription = wnsErrorDescription;
Expand Down

0 comments on commit a0dc0ac

Please sign in to comment.