【问题标题】:Pusher : : [{"type":"PusherError","data":{"code":4009,"message":"Connection not authorized within timeout"}}]Pusher : : [{"type":"PusherError","data":{"code":4009,"message":"Connection not authorized in timeout"}}]
【发布时间】:2021-05-27 18:07:32
【问题描述】:

我在 React Native 中使用 Pusher。

尝试从调试控制台获取消息。

成功获得 2 条消息,并且在我在控制台中收到此消息后:

Pusher :  : [{"type":"PusherError","data":{"code":4009,"message":"Connection not authorized within timeout"}}]

Pusher :  : ["State changed","connected -> disconnected"]

Pusher :  : [{"type":"WebSocketError","error":{"type":"PusherError","data":{"code":4009,"message":"Connection not authorized within timeout"}}}]

这是我的绑定:

channel.bind("Chat", function (data) {
      var newArr = initialMessages.reverse();
      var message = creteNewMessage(JSON.stringify(data));
      newArr.push(message);
      console.log(newArr);
    });

没有消息到达。

【问题讨论】:

    标签: pusher pusher-js


    【解决方案1】:

    您是否在 Pusher 应用设置中打开了授权连接?启用后,所有连接都需要订阅私人或在线频道,如果没有发生,则关闭连接。有关信息,请参阅https://pusher.com/docs/channels/using_channels/authorized-connections。 您应该关闭此设置,或者订阅私人或在线频道。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-10-03
      • 1970-01-01
      • 2023-02-17
      • 2020-10-25
      • 2023-01-17
      • 2013-07-29
      • 2022-12-01
      • 2019-02-10
      相关资源
      最近更新 更多