Giter VIP home page Giter VIP logo

Comments (3)

hellolibo avatar hellolibo commented on May 19, 2024

demo3 里使用了 localStorage 但这个不是换了机器就看不到之前的聊天情况了?

from js-realtime-sdk.

wangxiao avatar wangxiao commented on May 19, 2024

对的,设计实时通信的时候考虑的是实时通信与好友关系等逻辑是解耦合的,所以你需要自己存储。
这也是灵活的,因为我们不清楚你的好友逻辑。
你可以使用 LeanCloud 的存储,给每个用户建立一个好友关系,然后他们存储着对应的 roomId 即可。
每次聊天之前获取一下他们是否有 roomId 即可。

from js-realtime-sdk.

wangxiao avatar wangxiao commented on May 19, 2024

localStorage 只是随便写在 demo 中保持逻辑的,你真正用可以存储在服务器端,可以尝试使用 LeanCloud 的无模式存储。

from js-realtime-sdk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.