【问题标题】:strophe js receives a single message using with angular 4strophe js 使用 angular 4 接收一条消息
【发布时间】:2018-02-28 17:24:41
【问题描述】:

我正在使用 Strophe.js 连接 angular4 中的 XMPP 服务器。 connection.addHandler() 收到一条消息。我在连接成功后添加了这个监听器。

connection.addHandler(this.receiveMessage, null, 'message');

请说出我遗漏或不正确的地方。

【问题讨论】:

    标签: angular xmpp ejabberd strophe.js


    【解决方案1】:

    确保您的 receivedMessage 函数返回 true 以便在您收到新消息时继续被调用。如果它没有返回true,它只会被调用一次,你必须通过connection.addHandler()再次添加它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-02-10
      • 2023-03-31
      • 1970-01-01
      • 2023-03-16
      • 2020-02-18
      • 2019-03-31
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多