【问题标题】:Implement SockJS-client with STOMP messaging protocol in REACT NATIVE在 REACT NATIVE 中使用 STOMP 消息协议实现 SockJS 客户端
【发布时间】:2019-09-03 08:39:46
【问题描述】:

对于我的 web 应用程序,我使用带有 STOMP 消息传递的 socketJs。我也想用这是我的 react native 项目。尝试了几个解决方案,但这些都不起作用。

有人可以解释或帮助我如何使用 STOMP 实现套接字吗?

非常感谢

【问题讨论】:

    标签: react-native sockets websocket stompjs


    【解决方案1】:

    const socket = new SockJs(${BASE_URL}/api/websocket?access_token=${localStorage.getItem('access_token')}); this.stompClient = Stomp.over(socket);

    【讨论】:

      猜你喜欢
      • 2021-09-18
      • 1970-01-01
      • 2017-05-27
      • 2018-06-03
      • 2020-03-05
      • 2011-04-05
      • 2011-12-24
      • 2015-10-29
      • 2021-10-01
      相关资源
      最近更新 更多