如何在WP8中深度链接推送通知 [英] How to Deep Link Push Notification in WP8

查看:85
本文介绍了如何在WP8中深度链接推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Parse向我的应用发送推送通知。我遵循了文档中的所有步骤。

I am using Parse to send push notifications to my app. I followed all the steps present in the documentation. It works perfectly fine.

当我收到推送通知时,点击它会启动应用程序。但是我想导航到我的应用程序中的特定页面。我无法找到在哪里设置此导航参数。有办法吗?

When I receive the push notification, on tap of it will launch the application. However I want to navigate to a particular page in my app. I am unable to find out where to set this navigation parameter. Is there a way to do it ?

如果可能的话,如何在导航到该页面时通过查询字符串传递参数?

If this is possible then how to pass parameter via query string while navigating to that page?

推荐答案

我找到了这个示例。您可以将自定义xaml文件设置为启动url。
这是完整的项目: WNS通知Windows和Windows Phone通用应用示例。希望对您有所帮助。

I found this sample. You can set a custom xaml file as launching url. Here is the complete project:WNS Notifications for Windows and Windows Phone Universal App Sample. Hope it helps.

 var toastDescriptor = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText02);

        var txtNodes = toastDescriptor.GetElementsByTagName("text");

        txtNodes[0].AppendChild(toastDescriptor.CreateTextNode("SL8.1 Demo"));
        txtNodes[1].AppendChild(toastDescriptor.CreateTextNode("Deeplink me"));

        // Launch args
        var toastNode = toastDescriptor.SelectSingleNode("toast");
        ((XmlElement)toastNode).SetAttribute("launch", "/toastpage.xaml?findme=true");

        var toast = new ToastNotification(toastDescriptor);
        var toastNotifier = ToastNotificationManager.CreateToastNotifier();
        toastNotifier.Show(toast);

这篇关于如何在WP8中深度链接推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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