Windows Phone 7.5 - Push Notifications when app is tombstoned

不打扰是莪最后的温柔 提交于 2019-12-07 02:59:37

问题


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.

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.

Thanks


回答1:


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.



来源:https://stackoverflow.com/questions/10340474/windows-phone-7-5-push-notifications-when-app-is-tombstoned

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