【发布时间】:2018-06-24 08:00:55
【问题描述】:
我尝试从我的设备获取所有通知,但我无法获取应用程序名称。
UserNotificationListener notificationListener = UserNotificationListener.Current;
UserNotificationListenerAccessStatus accessStatus = await notificationListener.RequestAccessAsync();
if (accessStatus == UserNotificationListenerAccessStatus.Allowed)
{
var notifications = await notificationListener.GetNotificationsAsync(NotificationKinds.Toast);
foreach (var notification in notifications)
{
// Here is exception
System.Diagnostics.Debug.WriteLine(notification.AppInfo.DisplayInfo);
}
}
当我诉诸 AppInfo 属性时,我得到了 NotImplementedException。 我哪里错了?
【问题讨论】:
标签: c# push-notification uwp notifications