我想實現這樣的http://dotnettrain.blogspot.co.uk/2011/07/push-notifications-in-windows-phone-75.html推送通知基本面
我送,並在同一頁面接收。 A.xaml
有效載荷我試圖發送:在GetToastPayLoad
string message = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<wp:Notification xmlns:wp=\"WPNotification\">" +
"<wp:Toast>" +
"<wp:Text1>New Link Request</wp:Text1>" +
"<wp:Text2>"+data.Title+"</wp:Text2>" +
"</wp:Toast>" +
"</wp:Notification>";
而對於HttpRequest的標題是: -
.........................................
var request = (HttpWebRequest)WebRequest.Create(new Uri(channelUri));
request.Method = "POST";
request.ContentType = "text/xml";
payload = GetToastPayload(data);
request.Headers.Add("X-WindowsPhone-Target", "toast");
request.Headers.Add("X-NotificationClass", "2");
}
我能夠捕捉A.xaml響應如OnToastNotificationReceived並在消息框中打印詳細信息。
但是,當我刪除事件處理程序,我沒有得到我的正在運行的應用程序中的任何通知。
如何以正常方式接收和顯示正常的吐司通知?
* 我應該怎麼做,使這種普遍的,說我想無論用戶是要顯示:A.xaml,B.xaml,C.xaml 等 *