C# 使用push sharp导航到在windows phone toast通知中不起作用的特定页面
我正在使用push sharp向windows phone 8发送toast通知并获得这些通知。当前,当我点击toast应用程序启动时,我的应用程序的第一页打开。但当我点击toast时,我想导航到我的应用程序的特定页面 为此,我想我必须使用WindowsPhoneToastNotification的C# 使用push sharp导航到在windows phone toast通知中不起作用的特定页面,c#,xaml,windows-phone-8,toast,pushsharp,C#,Xaml,Windows Phone 8,Toast,Pushsharp,我正在使用push sharp向windows phone 8发送toast通知并获得这些通知。当前,当我点击toast应用程序启动时,我的应用程序的第一页打开。但当我点击toast时,我想导航到我的应用程序的特定页面 为此,我想我必须使用WindowsPhoneToastNotification的.withParameter()扩展名,但我无法获得应该在该扩展名的键和值对中传递的内容。另外。withNavigatePath()也不工作 正在使用此更新的代码。但仍然没有成功。应用程序未导航到所需
.withParameter()
扩展名,但我无法获得应该在该扩展名的键和值对中传递的内容。另外。withNavigatePath()
也不工作
正在使用此更新的代码。但仍然没有成功。应用程序未导航到所需页面
push.QueueNotification(new WindowsPhoneToastNotification()
.ForEndpointUri(new Uri("MYDeviceEndpointURI"))
.WithNavigatePath("/Home.xaml")
.WithText1("PushSharp")
.WithText2("This is a Toast"));
.WithParameter("param1","1")
更新3(因为其他更新不是解决方案)
我注意到一个小示例代码:
我在这里看到的区别是,在示例中,他们还添加了
.ForOSVersion()
。你能试一试吗?当你在没有任何推送通知的情况下打开应用程序时,你的当前登录页是什么?…当我在没有任何推送通知的情况下打开我的应用程序时,登录名是.xaml.Hmzz。。似乎你不是唯一有问题的人。有什么方法可以提供由PushSharp生成的xml模板吗?需要导航到Home.xaml页面,我已经写过了“/Home.xaml在中。使用NavigatePath
但仍然无法导航。如果不使用push sharp,我使用给定的代码,我可以使用参数名称和值导航到所需页面。但是使用push sharp导航发送toast通知时不起作用。再次更新了我的评论,你能再看一看吗:)它起作用了:)谢谢。我想知道我怎么会错过.ForOSVersion()
。但是仍然存在一些问题,在参数值的末尾,额外的&像/Home.xaml?q=1&
那样编写,这很烦人。实际上很奇怪,因为这个bug是8个月前修复的:代码本身也是如此:(第145行)
//-----------------------------
// WINDOWS PHONE NOTIFICATIONS
//-----------------------------
//Configure and start Windows Phone Notifications
push.RegisterWindowsPhoneService();
//Fluent construction of a Windows Phone Toast notification
//IMPORTANT: For Windows Phone you MUST use your own Endpoint Uri here that gets generated within your Windows Phone app itself!
push.QueueNotification(new WindowsPhoneToastNotification()
.ForEndpointUri(new Uri("DEVICE REGISTRATION CHANNEL URI HERE"))
.ForOSVersion(WindowsPhoneDeviceOSVersion.Eight)
.WithNavigatePath("/Home.xaml")
.WithParameter("param1","1")
.WithText1("PushSharp")
.WithText2("This is a Toast"));
);