I am trying to send a message to notification hub, but my tags are not saving.
I checked service hub with service hub explorer, and tags are empty:
Registration of device:
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;
}
Test method invocation that sends message to hub:
// 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:
Is that the case?
I know, it's confusing, but there're two completely separate kinds of tags that have have no relationship to each other whatsoever:
So when you call hs.Add(tag)
, the associated tags apply to the device registration (ie '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 (ie 'tags of the second kind'):
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.