使用 PubNub Presence 功能时,是否可以提供用户加入或离开 channel 时 PubNub 调用的 HTTP 回调?就我而言,我想调用 Parse.com 云函数。 澄清一下:我不想从客户端调用该函数,而是让 PubNub.com 服务器来处理它。
最佳答案
在 PubNub Presence 事件上调用 Web 服务
PubNub 提供从 PubNub.com 服务器生成的状态“HTTP 回调”。您必须要求您的客户经理为您启用;发送电子邮件至 support@pubnub.com 进行启用。请求“在线状态回叫事件”
和 “在线状态回叫非事件”
设置。您需要设置一个 dev/prod key 对以将 WebHook URL 指向不同的环境。
The HTTP callback URL that is triggered when a channel becomes active.
现在所有在线状态事件都支持 Webhook:加入、离开、超时和状态更改,以及 channel 事件和非事件事件。
有关完整说明,请阅读 this StackOverflow about PubNub Presence Webhooks and how to get them configured for you keys .
关于pubnub - 在 PubNub Presence 事件上调用 Web 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30596011/