c# - 该通知没有目标应用程序

标签 c# windows azure push-notification azure-notificationhub

我刚刚启动了用于 azure 推送通知的演示应用程序。在我的演示中,我可以向所有 Windows 设备广播通知,但我想使用标签向单个用户发送通知。因此,我遵循 Azure Notification Hubs Notify Users with .NET backend 中的所有说明和演示代码。 .

但是我在发送窗口和 WP 的推送通知时遇到错误。这是我的代码:

outcome = await Notifications.Instance.Hub.SendWindowsNativeNotificationAsync(toast, userTag);

我收到以下错误:

The remote server returned an error: (400) Bad Request. The notification has no target applications. The notification format is windows. Review the credentials specified in the notification hub description and the notification format. .TrackingId:2aca8783-c5eb-41f8-a821-6f457806ca86_G7,TimeStamp:11/29/2016 1:40:07 PM

  • 我尚未在 Windows 应用商店中注册我的应用程序。我想这会造成问题,但为什么它适用于广播呢?当我向单个用户发送带有标签时,它会给出上述错误。

  • 请让我知道我错在哪里。是否需要在 Windows 应用商店注册应用程序才能为单个用户发送带有标签的通知?

最佳答案

你经历过Register your app for the Windows Store吗?和 Configure your notification hub

如果是这样,测试发送(从门户)是否有效? (Here's an example 如何从经典 Azure 门户和 Visual Studio 执行此操作,请参阅“验证消息通知”部分。)

广播模板与您用于发送给个人用户的模板之间有什么区别吗?

关于c# - 该通知没有目标应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40871201/

相关文章:

c# - 使用 LINQ 获取 ID 列表并添加到数据库中

c# - C#中的延迟执行

windows - 在“任务计划程序”中的“路径开始”中被忽略

linux - centos 7中Docker启动失败

Azure 移动应用自定义身份验证

c# - 仅从字符串中提取最右边的 n 个字母

c++ - 重叠 I/O : some functions are still missing

c++ - 根据 GetLastError,直接写入磁盘会导致错误代码 5

azure - SQL Azure 高级层一次不可用的时间超过一分钟,我们的利用率约为 10-20%,如果这样的话

c# - 在 Windows 10 中获取夜灯模式的状态