使用azure功能的通知中心

时间:2016-11-27 15:43:26

标签: azure azure-notificationhub azure-functions

如何使用azure函数中的hub发送通知:

context.bindings.notification = {
   message: "Hello from " + req.body.name
};

收到错误。

写的文件:

This example sends a notification for a template registration that contains

使用azure功能时如何注册模板?

1 个答案:

答案 0 :(得分:3)

首先,这是指向notification hub bindings docs

的链接

以下是您需要做的事情:

  1. 来自移动客户端应用,register a template
    • 即。 {"aps": {"alert": "$(message)"}}
  2. 从azure函数发送模板有效内容。您应该收到已在模板中注册的设备上的推送
    • 即。 context.bindings.notification = { message: "this goes in the $(message) above" };