BackGround Task to trigger if any changes in the Action Center

我是研究僧i 提交于 2019-12-02 11:54:48

问题


I need to trigger my background task when the application added the toast notification to the action center. I have tried with ToastNotificationHistoryChangedTrigger and it's not triggering the task when the application added the toast notification. Is there any solution for it?


回答1:


ToastNotificationHistoryChangedTrigger is fired whenever the collection of toast notification history from your app changes on the device. Subscribing this trigger, will allow your app to get notified when:

  • A toast notification is removed by the user from action center;
  • A toast notification is expired and removed by the system from action center;
  • A toast notification is delivered form your app, via push;

Note: the only thing your app wouldn’t be notified for, is a local toast being popped/added, since it is not necessary to notify your app client about something it just did.

So generally, an app can be notified with ToastNotificationHistoryChangedTrigger when the app’s collection of notifications is changed in any way that’s not caused by the app’s local client. If your application added the toast notification by itself, the trigger won't be fired.



来源:https://stackoverflow.com/questions/41540805/background-task-to-trigger-if-any-changes-in-the-action-center

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