我刚刚启动了用于 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/