的Windows Phone 8的通知和后台任务 [英] Windows Phone 8 notifications and background tasks

查看:184
本文介绍了的Windows Phone 8的通知和后台任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经搜索官方论坛和文档等所有的地方,但一直没能找到一个具体的答案。

I have searched the official forums and documentation and all other places, but haven't been able to find a concrete answer.

问。在Windows Phone 8的,是有可能申请到一个推送通知作出回应,并执行任务,而它在后台?

由于据我所了解,对于面包和瓷砖通知后,当应用程序是不是在前台,有没有钩在所有它能够对传入的消息作出响应。

As far as I can understand, for Toast and Tile Notifications, when the app is not in the foreground, there are no hooks at all for it to be able to respond to the incoming message.

我觉得原通知是这样做的正确的选择,因为我不需要更新应用瓷砖,甚至显示Toast通知。但是,我一直没能找到一个例子,还是在单证,如果我能做到这一点。

I think "raw notifications" are the correct choice for this, since I am not required to update the app tile, or even show a Toast Notification. But, I haven't been able to find an example, or in the documentations, if I can do this.

我发现几个环节而谈做这 Windows应用商店的应用,但我想找出这是否可以为的Windows Phone 8

I have found several links which talk about doing this for Windows store apps, but I want to find out if this can be done for Windows Phone 8.

我来完成已检查这个其他线程,

I have checked this other thread,

的Windows Phone 8的通知

后台任务如果答案之一表明,的WhatsApp 其实有这样的黑客,以收到推送通知后,下载邮件。那么,是不是回答我的问题,一个

Where one of the answer suggests that Whatsapp actually has a hack for this, to download the messages after a push notification is received. So, is the answer to my question, a NO?

推荐答案

这在Windows Phone的变化8.1。从原始通知概述(Windows运行时的应用程序)

This has changed in Windows Phone 8.1. From Raw notification overview (Windows Runtime apps)

接听原始通知

有两种途径,通过它您的应用程序可以您的应用程序运行时

There are two avenues through which your app can be receive raw notifications:


  • 通过通知传递的事件:被接收原始
    的通知。

  • 通过原通知触发后台任务,如果您的应用程序启用运行后台任务。

应用程序可以使用这两种机制来接收原始通知。如果一个应用程序
实现由原材料引发的通知同时通知传递的事件处理程序和后台
任务,通知
传递活动将在应用程序运行时的优先级。

An app can use both mechanisms to receive raw notifications. If an app implements both the notification delivery event handler and background tasks that are triggered by raw notifications, the notification delivery event will take priority when the app is running.


  • 如果应用程序正在运行,则通知传递活动将优先于后台任务和应用程序将需要处理的第一次机会通知。

  • 的通知传递的事件处理程序可以指定,由事件的PushNotificationReceivedEventArgs.Cancel属性设置为true,即原始通知不应该传递给它的后台任务,一旦处理程序退出。如果取消属性设置为false或未设置(默认值为false),原通知会触发后台任务的通知传递的事件处理程序已完成其工作后。

这篇关于的Windows Phone 8的通知和后台任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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