我正在尝试向通知中心发送消息,但我的标签未保存。
I checked service hub with service hub explorer, and tags are empty:
设备注册:
var hs = new HashSet<string>();
hs.Add(tag);
hs.Add(sys.ToString());
switch (sys)
{
case SystemVendorEnum.Android:
await Hub.CreateGcmNativeRegistrationAsync(pnsHandle, hs);
break;
case SystemVendorEnum.Ios:
await Hub.CreateAppleNativeRegistrationAsync(pnsHandle, hs);
break;
}
将消息发送到集线器的测试方法调用:
// param1: json payload, param2: tag
await Hub.SendGcmNativeNotificationAsync("{ \"data\": { \"methodId\":\"1\" }}", "ae65d2d5-103e-4023-a784-c5c8e2684db0");
Is there anything I am missing?
I don't have tags in notification hub:
是这样吗?
我知道,这很令人困惑,但是有两种完全不同的标签,彼此之间没有任何关系:
- Azure 通知中心服务上下文中的标记。这些适用于设备注册。所以,它是通知中心service-特定并描述设备。看路由和标签表达式 https://msdn.microsoft.com/en-us/library/azure/dn530749.aspx更多细节。
- 将其标记为 Azure 资源管理器 (ARM) 的概念。这些适用于 Azure 中的任何资源。所以就是platform-具体并用于描述any您在 Azure 中拥有的资源/服务。看使用标签来组织 Azure 资源 https://azure.microsoft.com/en-us/documentation/articles/resource-group-using-tags/更多细节。
So when you call hs.Add(tag)
, the associated tags apply to the device registration (i.e. 'tags of the first kind') and should show up in the Service Bus explorer:
And if you go to Azure portal and navigate to any resource (or as you did, to your hub), you'll see ARM tags there (i.e. 'tags of the second kind'):
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)