遵循概述的内容 here到目前为止,我已经能够读取所有注册的设备,通过 ID 删除设备注册,并通过标签获取特定的设备注册。我想要做的是使用特定标签注册设备。
我找到了指定使用此 POST 端点的页面:
https://{namespace}.servicebus.windows.net/{NotificationHub}/registrations/?api-version=2015-01
我已应用了正确的 header - 内容类型、授权和 x-ms-version。
我的问题来自正在发送的 XML 正文。在哪里可以找到正确的 ChannelUri 或者 Azure/Firebase 中是否有其他内容可以用来代替 channel uri?
<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom">
<content type="application/xml">
<WindowsRegistrationDescription xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/netservices/2010/10/servicebus/connect">
<Tags>myTag, myOtherTag</Tags>
<ChannelUri>{ChannelUri}</ChannelUri>
</WindowsRegistrationDescription>
</content>
此外,我认为上述 api 调用将成功向 azure 通知中心注册设备是否正确,还是我在某处遗漏了步骤?
最佳答案
ChannelUri 是一个将通过 UWP 提供给您的值,它允许您定位应用程序正在其上运行的特定 Windows 计算机(例如,您上面提供的示例是 WNS 特定负载。)
每个推送通知服务 (PNS) 都有自己的机制来唯一标识应接收通知的设备。您找到的引用页面上还包含其他示例,例如您会注意到 Apple 设备需要 DeviceToken
。
关于c# - 通过 Microsoft Azure 注册设备时的 channel uri 是什么 创建注册调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60252512/