I'm setting up a Web API project that uses Azure Push Notifications. I'd like to use the new "Installation" model instead of the older "Registration" model. The documentation is a bit limited however.
Looking at MSDN, Microsoft.Azure.NotificationHubs.Installation
has a Tags
property.
There is also has a Templates
property. The template type is InstallationTemplate
and surprisingly also has Tags
.
The templates are not just a list but a dictionary that maps from string
to InstallationTemplate
.
I understand the idea behind tags. But I'm confused about the two tag properties and the key of the dictionary.
I saw an example where the Installation.Tag
is set to "foo" and then two templates are added with the keys "template1" and "template2". The InstallationTemplate.Tag
was set to "tag-for-template1" and "tag-for-template2".
- Do the two tag values have to match?
- What is each of them used for?
- What should the key of the template dictionary be?
- If I use the method to send a notification via the NotificationHubClient, I can specify a tag - what is it matched against and which template will be picked?