How to handle WNS push notifications in Windows Phone 8.1 -silverlight

南笙酒味 提交于 2019-12-11 06:46:24

问题


I implemented WNS push notification in my Windows Phone application. And the application are getting the toast notifications successfully.[Sometimes with a delay].

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.

Is there any way or api to get/store those entire toast notification list in Windows phone ?

I know ToastNotificationHistory class, But where I could see only clear or remove notifications.Please provide me clarification on it is possible or not ?

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 ?

Please provide me a detailed clarifications on my work around.

related SO question is here

Thanking you all.


回答1:


  • 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.

  • 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.

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.

Hope it help you :)



来源:https://stackoverflow.com/questions/29562659/how-to-handle-wns-push-notifications-in-windows-phone-8-1-silverlight

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