Windows Phone 7.5-应用程序逻辑删除时推送通知 [英] Windows Phone 7.5 - Push Notifications when app is tombstoned

查看:85
本文介绍了Windows Phone 7.5-应用程序逻辑删除时推送通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了一个Windows 7.5电话应用程序,该应用程序使用MPNS注册了磁贴和吐司推送通知.我拥有所有的基础设施,并且电话已在MPNS中注册.我将ChannelUri本地保存在电话中,然后将ChannelUri发布到我的网站上的休息服务端点,该端点记录了设备/ChannelUri.我能够从Web服务发送吐司和平铺消息,并在电话上毫无问题地接收它们.如果应用程序正在运行,则可以捕获ShellToastNotificationReceived事件,并且可以读取推送通知详细信息,并将消息保存到应用程序中的本地数据库中,并且消息还会在列表框中显示给用户.该系统与我的网站断开了连接,而不必注册ChannelUri,并且通知中包含了我需要的所有数据.

I have written a Windows 7.5 phone app that registers for tile and toast push notifications with MPNS. I have all the infrastructure working and the phone registers with MPNS. I save the ChannelUri locally on the phone and then post the ChannelUri to a rest service endpoint on my website which records the device / ChannelUri. I'm able to send toast and tile messages from the web service and receive them on the phone without any problem. If the application is running I'm able to trap the ShellToastNotificationReceived event and can read the push notification details and I save the message to a local database in the application and the messages are also displayed to the user in a Listbox. The system is disconnected from my website other than having to register the ChannelUri and all the data I need is contained with the notification.

我的问题是,当应用程序已被逻辑删除并发送推送通知时,我会看到电话操作系统显示的Toast消息,如果单击Toast,我已经在应用程序中放置了一个指向页面的URI, -启动应用程序,我可以捕获消息中的所有数据并将其再次保存到数据库中.但是,如果应用程序被逻辑删除并且用户错过了吐司,那么我将无法保存该消息,除非我编写了一些逻辑以返回到我的服务器并检查我本地拥有的消息是否与它发送的消息匹配,否则该消息将丢失.应用程序重新启动并与服务器重新同步时,我是否丢失了某些东西,或者是否必须对服务器进行检查,以查看用户可能错过的任何吐司推送通知.

My question is when the application has been tombstoned and I send a push notification I see a toast message displayed by the phone OS and if I click on the toast I have put a URI pointing to a page in my application and this re-launchs the app and I can trap all the data in the message and can save it again to the database. But if the application is tombstoned and the user misses the toast I have no way of saving that message it is lost unless I write some logic to go back to my server and check if the messages I have locally match the ones it sent. Am I missing something or am I going to have to run a check with my server when the app re-launches and re-sync with my server for any toast push notifications the user might have missed.

谢谢

推荐答案

在应用程序未运行或逻辑删除的情况下收到推送通知时,如果未对丢失的吐司做任何操作,则无法处理数据.您可能需要在服务器上使用确认逻辑来检查是否接收到消息.

When a push notification is received while the application is not running or is tombstoned there is no way to handle the data if nothing was done with the missed toast. You might need confirmation logic on the server to check whether the message is received or not.

这篇关于Windows Phone 7.5-应用程序逻辑删除时推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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