Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/296.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 使用push sharp导航到在windows phone toast通知中不起作用的特定页面_C#_Xaml_Windows Phone 8_Toast_Pushsharp - Fatal编程技术网

C# 使用push sharp导航到在windows phone toast通知中不起作用的特定页面

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()也不工作 正在使用此更新的代码。但仍然没有成功。应用程序未导航到所需

我正在使用push sharp向windows phone 8发送toast通知并获得这些通知。当前,当我点击toast应用程序启动时,我的应用程序的第一页打开。但当我点击toast时,我想导航到我的应用程序的特定页面

为此,我想我必须使用WindowsPhoneToastNotification的
.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"));
);