Azure的通知集线器TEMPLATENAME的使用 [英] Usage of Azure Notification Hubs templateName

查看:269
本文介绍了Azure的通知集线器TEMPLATENAME的使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了科尔多瓦,并与Azure的通知集线器谈了Mvc5应用程序示例应用程序。
注册是由后台处理,因为标签必须是安全的。

I've created a sample App with Cordova and a Mvc5 application that talks with Azure Notification Hubs. Registrations are handled by the backend because tags must be secured.

我们已经使用从后端的IOS,WP8和Android平台的注册三个不同的模板;后端可以通过发送带有 $消息的有效载荷推送通知 sendtemplatenotificationasync

We have used three different templates registered from the backend for the iOS,WP8 and Android platforms; the backend can send a push notification with a $message payload using sendtemplatenotificationasync.

它的工作,但我们还没有使用 TEMPLATENAME

It's working but we have not used the templateName.

从读您的应用程序后端文档注册,我发现这一点:

Reading the Registration from your app Backend documentation , I've found this:

您可以使用的TEMPLATENAME属性识别模板
  注册。

"You can identify the templates by using the TemplateName property of the registration".

有一次,我已经成功地创建一个<一个一个注册href=\"http://msdn.microsoft.com/en-us/library/microsoft.servicebus.notifications.windowstemplateregistrationdescription.templatename.aspx\">templateName我能做些什么呢?

Once I have successfully created a Registration with a templateName what can I do with it?

我希望能够找到一个API发送方法能够指定,除了标记或标签前pression,具体 TEMPLATENAME ;我还没有发现这样的事。

I expected to find an API Send method to be able to specify, besides the tags or tag expression, a specific templateName; I have not found anything like this.

有什么意义和 TEMPLATENAME

推荐答案

模板名称只是模板注册的描述性标签。它不打算用于以编程识别登记,因此,也有不使用模板名称任何API方法。你不应该将其用于除调试或记录的任何其他。 (我根本不设置模板的名字......)

The template name is just a descriptive label for the template registration. It is not intended to be used to programmatically identify registrations and therefore there aren't any API methods that use the template name. You shouldn't use it for anything other than debugging or logging. (I don't set template names at all...)

您可以查看官​​方 ANH Java SDK的GitHub上的例如:如果<一个href=\"https://github.com/Azure/azure-notificationhubs-java-backend/search?utf8=%E2%9C%93&q=templatename&type=$c$c\"相对=nofollow>搜索TEMPLATENAME,你不会找到比登记设置模板名称以外的其他用途。

You can check the official ANH Java SDK on GitHub for example: If you search for "templatename", you won't find any usage other than setting the template name for a registration.

您所有的模板应该使用相同的模板参数,如果他们针对同一通知类型。然后你只需一次发送通知范本的所有参数的所有平台。这是用例模板注册。据我所知,您可以为特定的平台,不指定参数,就不会收到它注册的其他参数。只要确保你在发送的所有模板中定义的所有参数。

All your templates should use the same template parameters, if they are intended for the same notification type. Then you just send a template notification with all the parameters to all platforms at once. That is the use case for template registrations. As far as I know, you can have additional parameters for specific platforms, registrations that don't specify a parameter, just won't receive it. Just make sure you send all parameters that are defined in all templates.

如果您wan't使用不同的模板,使用标签,例如登记区分区分平台使用标签,如平台:Android的,平台:iOS版等,或用于区分不同的参数模板使用模板:PersonalMessage,模板:GroupMessage,模板:广播,等等。

If you wan't to distinguish between registrations with different templates, use tags, e.g. for distinguishing platforms use tags like "Platform:Android", "Platform:iOS", etc. Or for distinguishing templates with different parameters use "Template:PersonalMessage", "Template:GroupMessage", "Template:BroadCast", etc...

这篇关于Azure的通知集线器TEMPLATENAME的使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆