从HERE,我发现我可以发送一个toast通知,当用户点击它时会打开一个特定的页面,这就是我想要的。推送消息应该是这样的:
string message = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<wp:Notification xmlns:wp=\"WPNotification\">" +
"<wp:Toast>" +
"<wp:Text1>title</wp:Text1>" +
"<wp:Text2>message</wp:Text2>" +
"<wp:Param>/Page2.xaml?NavigatedFrom=Toast</wp:Param>" +
"</wp:Toast>" +
"</wp:Notification>";
等同于Parse(我不是100%肯定):
push.Data = new Dictionary<string, object>{
{"title", "title"},
{"alert", "message"},
{"param", "/Page2.xaml?NavigatedFrom=Toast"}
};
我的应用关闭后,烤面包会正确显示。但是点按它始终会打开默认页面而不是 Page2.xaml 。 Parse似乎取代了我的&#34; param&#34;带有很长字符串的字符串。像这样:
{[wp:Param, ?pushJson=%7B%22title%22:%22title%22,%22alert%22:%22message%22,%22param%22:%22/Page2.xaml?NavigatedFrom=Toast%22,%22push_hash%22:%2278e731027d8fd50ed642340b7c9a63b3%22%7D]} System.Collections.Generic.KeyValuePair<string,string>
那么如何才能让toast打开 Page2.xaml ?