0

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

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

使用这个更新的代码。但仍然没有成功。应用程序没有导航到所需的页面。

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

1 回答 1

1

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

我注意到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()。你可以试一试吗?

于 2013-11-19T13:06:58.827 回答