如果用户点击Toast通知来打开我的应用,是否可以
若然,怎么样?
答案 0 :(得分:1)
如此处所述:http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868212.aspx
创建吐司,使其具有launch
个参数:
((XmlElement)toastNode).SetAttribute("launch", "{\"type\":\"toast\",\"param1\":\"12345\",\"param2\":\"67890\"}");
toast XML将显示为
<toast launch="{"type":"toast":"param1":"12345":"param2":"67890"}">
<visual>
<binding template="ToastImageAndText01">
<image id="1" src="ms-appx:///images/redWide.png" alt="red graphic"/>
<text id="1">Hello World!</text>
</binding>
</visual>
</toast>
然后在应用的OnLaunched
方法中:
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
string launchString = args.Arguments
....
}