How to Deep Link Push Notification in WP8

夙愿已清 提交于 2019-12-13 04:43:35

问题


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?


回答1:


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


来源:https://stackoverflow.com/questions/25927307/how-to-deep-link-push-notification-in-wp8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!