Toast通知,如果应用程序没有运行 [英] Toast notification, when app is not running

查看:232
本文介绍了Toast通知,如果应用程序没有运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写的应用程序在Windows Phone 8与推送通知(仅限吐司),我还没有MSSQL工作而送推到我的移动应用服务。发送数据有这样的格式如下( TYPEID 的是int,它告诉什么应用程序应该做的数据的):

I write app on Windows Phone 8 with service of push notification (only toast), I have yet MSSQL Job which send pushes to my mobile app. Send data have this below format (typeId is int, which tell what app should do with data):

<?xml version=\"1.0\" encoding=\"utf-8\"?>
<wp:Notification xmlns:wp=\"WPNotification\">
<wp:Toast>
<wp:Text1>title</wp:Text1>
<wp:Text2>subtitle</wp:Text2>
<wp:Data>typeId;data</wp:Data>
</wp:Toast>
</wp:Notification>

在推动收入时,我已经运行的应用程序,我可以通过服务的方法我的应用程序(这种情况下正常工作)

When push income when I have running app, I can service my app by method (this case works fine)

httpChannel.ShellToastNotificationReceived += 
    new EventHandler<NotificationEventArgs>(httpChannel_ShellToastNotificationReceived);

httpChannel.BindToShellToast();

我的问题是无法维修敬酒推送通知,如果应用程序没有运行。按收入从XML文本,但是当我点击通知我进入我的应用程序的主页。我怎么可以将我的code来决定由 TYPEID 的做的,数据的从XML

My problem is unable to service toast push notification, when app is not running. Push income with texts from XML, but when I click notification I go into main page of my app. How can I attach my code to decide what to do by typeId and data from XML

推荐答案

我找到的解决方案:XML应该包含

I find solution: XML should contains

<wp:Param></wp:Param>

部分在&LT; WP:吐司&GT; 部分。在行我可以把​​视图联系地址与查询字符串。点击通知栏后,我会重定向到这个观点。从查询字符串参数会决定(在的NavigateTo事件),什么程序必须做:)

section inside <wp:Toast> section. In rows I can put view adress with query string. After click notification bar I will redirect to this view. Parameters from query string will decide (in NavigateTo event) what program has to do :)

这篇关于Toast通知,如果应用程序没有运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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