Windows Phone Silverlight 8.1不支持Windows.UI.Notifications.ToastNotification API?

时间:2014-08-10 16:57:48

标签: c# windows-phone windows-phone-8.1

我正在尝试验证我的应用程序,但是我收到以下错误: 发现错误:支持的API测试检测到以下错误:

This API is not supported for this application type - Api=Windows.UI.Notifications.ToastNotification. Module=. File=X.Service.dll.
This API is not supported for this application type - Api=Windows.UI.Notifications.ToastNotification..ctor. Module=. File=X.Service.dll.
This API is not supported for this application type - Api=Windows.UI.Notifications.ToastNotification.put_SuppressPopup. Module=. File=X.Service.dll.
This API is not supported for this application type - Api=Windows.UI.Notifications.ToastNotificationManager. Module=. File=X.Service.dll.
This API is not supported for this application type - Api=Windows.UI.Notifications.ToastNotificationManager.CreateToastNotifier. Module=. File=X.Service.dll.
This API is not supported for this application type - Api=Windows.UI.Notifications.ToastNotificationManager.GetTemplateContent. Module=. File=X.Service.dll.
This API is not supported for this application type - Api=Windows.UI.Notifications.ToastNotifier. Module=. File=X.Service.dll.
This API is not supported for this application type - Api=Windows.UI.Notifications.ToastNotifier.Show. Module=. File=X.Service.dll.
This API is not supported for this application type - Api=Windows.UI.Notifications.ToastTemplateType. Module=. File=X.Service.dll.

Impact if not fixed: Using an API that is not part of the Windows SDK for Windows Phone Store apps violates the Windows Phone Store certification requirements.

但是,如果你查看这些msdn页面,你会发现它在WP 8.1 Silverlight中得到了明确的支持: http://msdn.microsoft.com/library/windows/apps/windows.ui.notifications.toastnotification.aspx http://msdn.microsoft.com/en-us/library/windows.ui.notifications.aspx

Minimum supported phone Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

其他人有这个问题吗?

1 个答案:

答案 0 :(得分:2)

我发现了这个问题。它位于WMAppManifest.xml中,如果要使用Windows.UI.Notifications,则必须选择WNS,否则您必须使用ShellToast。查看此页:

http://msdn.microsoft.com/en-us/library/windows/apps/dn642085%28v=vs.105%29.aspx