如何在 Windows Phone 8.1 -silverlight 中处理 WNS 推送通知 [英] How to handle WNS push notifications in Windows Phone 8.1 -silverlight
问题描述
我在 Windows Phone 应用程序中实现了 WNS 推送通知.并且应用程序正在成功获取 Toast 通知.[有时会有延迟].
I implemented WNS push notification in my Windows Phone application. And the application are getting the toast notifications successfully.[Sometimes with a delay].
现在,只有当应用程序未打开时用户点按时,toast 通知功能才会起作用.无论如何,用户从操作中心刷出通知,因此用户看不到错过的通知.
Now toast notification functionality will work only when the user tap it when the application is not open. In any case the user swipe out the notifications form the action center,so the user could not see the missed notifications.
有没有办法或api来获取/存储那些整个toast通知Windows 手机中的列表?
Is there any way or api to get/store those entire toast notification list in Windows phone ?
我知道ToastNotificationHistory类,但在那里我只能看到清除或删除通知.请向我说明是否可能?
I know ToastNotificationHistory class, But where I could see only clear or remove notifications.Please provide me clarification on it is possible or not ?
此外,当设备处于低电量状态时,设备上不会出现 Toast 通知.所以用户也错过了.这个案子也怎么处理?
Also when the device is on low power state, no toast notifications are coming on the device. So the user misses that too. How to handle this case too ?
请详细说明我的工作.
相关的 SO 问题是这里一个>
谢谢大家.
推荐答案
嗨 asitis,我想让你知道
ToastNotificationFactory 的Clear 和 Remove
方法仅适用于那些由应用程序本身生成(本地通知).这些方法做不到他们对来自 WNS 的那些通知说了什么服务.Hi asitis, I would like you to know that
ToastNotificationFactory's Clear and Remove
methods only apply to those notifications that are generated by the app itself(local notifications). These methods can not do what they are saying to those notifications that are coming from WNS service.此外,当
时,您对 WNS 通知没有太多控制权应用程序已关闭.它们都由用户处理.就像他们
已删除它们或阅读它们,则它们不再可用.Also You don't have much control over the WNS notifications when
application is closed. They are all handled by user. Like if they
have deleted them or read then they are not available anymore.愿您的功能将由您自己的服务器完成这个保存/检索通知的事情.通过端点到您的客户端应用程序.然后你可以使用后台代理来获取这些
无需用户交互的通知并发送内部
从后台代理本身通知用户.May your functionality will be fulfilled by your own server that does this saving/retrieving notification things. over an endpoint to your client app. Then you may use Background agents to fetch these
notifications without the user interaction and send the internal
notification to the user from background agent itself.但是背景代理不是好东西,因为他们吃
电池和用户可以有意为所有应用禁用它们.所以你的实施将没有任何用处.But background agents are not the good things because they eat the
battery and user can intentionally disable them for all apps. so your implementation will not be of any use.所以 IMO 请检查您的要求并尝试弄清楚您到底需要什么.另请阅读推送通知使用指南我认为这 => 推送通知指南 肯定会有帮助.
So IMO please review your requirement and try to figure out what exactly you need. Also read guidelines of pushnotifications usage I think this => Push Notification Guidelines will definitely help.
通知禁用 :- 为此,不要使用任何客户端逻辑/代码,因为在这种情况下,每次逻辑更改时您都必须重新发布客户端(应用程序).所以把这个逻辑放在你发送通知的地方(服务器).喜欢:-过滤如果用户..您可以在将来根据需要更改此过滤器逻辑.
Notification Disabling :- for this don't use any client side logic/code because in this case you have to re-publish the client(app) every time your logic changes. So put this logic from where(server) you are sending the notifications. like :- filtering if users.. you can change this filter logic according to your needs in future.
希望对你有帮助:)
这篇关于如何在 Windows Phone 8.1 -silverlight 中处理 WNS 推送通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!