Toast Notification not working

旧巷老猫 提交于 2019-12-02 02:51:49

You should set toast capable to yes in app package.

Be sure that you checked the box in the App's config file to enable Notifications.

The property settings of your object notifier told you why the toast can't be displayed:

0: Enabled, All notifications raised by this app can be displayed.

1: DisabledForApplication, The user has disabled notifications for this app.

2: DisabledForUser, The user or administrator has disabled all notifications for this user on this computer.

3: DisabledByGroupPolicy, An administrator has disabled all notifications on this computer through group policy. The group policy setting overrides the user's setting.

4: DisabledByManifest, This app has not declared itself toast capable in its package.appxmanifest file. This setting is found on the manifest's Application UI page, under the Notification section. For an app to send toast, the Toast Capable option must be set to "Yes".

http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.notifications.notificationsetting.aspx

You can change directly your Package.appxmanifest from code page :

add ToastCapable to the VisualElements Tag

 <VisualElements  ToastCapable="true">

Some times the screen of the Package.appxmanifest dosen't have the option to change it:

Need set small icon for notifications!!!

Have you tried to make the application Toast Capable? check this thread: Toast notification isn't working?

An interesting issue I ran into is I was using toast with images. I had the images in a dependent assembly with copy to output directory. Scheduling toast just failed silently. Ondemand toast failed with an HRESULT of E_FAIL (no other information). When I finally copied the images into the main project (with copy to output directory) then they started working.

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