导航到特定页面在Windows Phone Toast通知中无法使用推锐功能工作 [英] navigation to particular page not working in windows phone toast notification using push sharp

查看:93
本文介绍了导航到特定页面在Windows Phone Toast通知中无法使用推锐功能工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用推送急件向Windows Phone 8发送烤面包通知,并获取这些通知.目前,当我点击Toast应用程序启动时,我的应用程序的第一页打开.但是,除了此以外,我还想在单击Toast时导航到应用程序的特定页面.

I am sending toast notifications to windows phone 8 using push sharp and getting those notification. Currently when I tap on toast app launches and first page of the my app opens up. But instead of this i want to navigate to particular page of my app when i click on toast.

为此,我必须使用WindowsPhoneToastNotification的.withParameter()扩展名,但是我无法获取应在此扩展名的键和值对中传递的内容.同样,.withNavigatePath()也无法正常工作.

I think for that I have to use .withParameter() extension of WindowsPhoneToastNotification, but I am not able to get what should be passed in key and value pair of this extension. Also .withNavigatePath() is also not working.

使用此更新的代码.但仍然没有成功.App无法导航到所需页面.

Using this updated code.But still no success.App is not navigating to the desired page.

push.QueueNotification(new WindowsPhoneToastNotification()
    .ForEndpointUri(new Uri("MYDeviceEndpointURI")) 
    .WithNavigatePath("/Home.xaml")
    .WithText1("PushSharp")
    .WithText2("This is a Toast"));
    .WithParameter("param1","1")

推荐答案

更新3 (因为其他更新不是解决方案)

Update 3 (as the other updates weren't the solutions)

我注意到 GitHub 上的一小段示例代码:

I noticed a small example code on GitHub:

//-----------------------------
// 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"));
);

我在这里看到的区别是在示例中他们还添加了.ForOSVersion().你可以试试看吗?

The difference I see here is that in the sample they added also .ForOSVersion(). Can you give that a try?

这篇关于导航到特定页面在Windows Phone Toast通知中无法使用推锐功能工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆