1
头图

build an online chat room from 0, only 4 steps!

Unlike single chat rooms and chat group chat, is a class of integrated multiple IM functions integrally large-scale real-time message distribution system. In 2000, when we entered the new century, chat rooms as a new type of instant messaging scene quickly among young people. 1611dc93e2eafd "Netease Chat Room" and "Bihai " 1611dc93e2eaff led the boom in voice chat at that time.

Today, the momentum of the chat room . It is widely used in 1611dc93e2eb14 online KTV, Lianmai Kaihei, anchor PK, online show and other scenes. It also has interactive methods such as text, emoticons, likes, and flowers. While building a bridge of communication, the gameplay is also more varied.

small classroom, we will teach you how to quickly integrate the chat room 1611dc93e2eb28, and realize the functions of entering and leaving the chat room, simple message sending and receiving, and rights management .

Video explanation

https://www.bilibili.com/video/BV1Xq4y1S7pU/

Integrated chat room-basic articles

Step1 Initialize and enter the chat room

There are two ways to enter the chat room: enter the chat room in independent mode and enter the chat room in non-independent mode.

  • The standalone mode refers to the way to enter the chat room when the IM is not logged in. It is aimed at business scenarios that only need the chat room function. Please import NIM_Web_Chatroom_*.js and initialize the chat room instance through Chatroom.getInstance({...}).
  • Non-independent mode refers to the method of completing IM login first and then entering the chat room, aiming at business scenarios that require IM and chat room functions. Please introduce NIM_Web_SDK_*.js, and please use SDK.NIM.getInstance({...}) and SDK.Chatroom.getInstance({...}) to initialize IM and chat room instances respectively

Here to facilitate the demonstration, select the independent mode:

Step2 Send and receive messages

Messages can be sent/received after successfully entering the chat room

Step3 Permission management

Chat room member management and chat room information query

Step4 Leave the chat room

Leave or switch chat room

Integrated chat room-Demo

Step1 Download the demo

Demo link: https://github.com/netease-kit/NIM_Web_Demo, download it locally, open it through IDE after decompression, and get APP_KEY first during download;

how to get APP_KEY?

If you are already a NetEase Yunxin developer, you can directly obtain APP_KEY from the control background of NetEase Yunxin;

If it is the first experience, you need to go to NetEase official website (1611dc93e2ecf2 http://163.lu/f04GM3) to register Yunxin account-create application-click App_Key management to get relevant information.

Step2 Run Demo

Enter the appkey corresponding to the environment in NIM_Web_Demo-master\webdemo\imNew\js\config.js, and then execute the npm install and node app commands in the demo root directory

Step3 Experience the Demo function

Open the http://127.0.0.1:8182/webdemo/imNew/index.html address to experience the demo function; (it is recommended to log in to the account first)

In the demo, the code for sending and receiving messages, banning, blocking and other related functions is in NIM_Web_Demo-master\webdemo\imNew\chatroom\src\js\link.js and room.js. You can refer to the API documentation to add more functions by yourself.

Summarize

The above is a detailed explanation of the access process of the Demo Web end of the NetEase Yunxin chat room solution. According to the above steps, the establishment of the chat room can be easily completed.

Building of any system is not easy, especially for social entertainment products, from research to build higher chat room means labor costs, time and capital costs . chat room solution provided by Netease Yunxin, a convergent communication cloud service expert, can be quickly 1611dc93e2eddb can complete the integration work in 1 day and can easily cope with high-concurrency scenarios with hundreds of millions of daily activities. will continue to polish the underlying technical capabilities, provide developers with more simple integration of 1611dc93e2eddd, and quick access to 's audio, video and instant messaging solutions.


网易数智
619 声望140 粉丝

欢迎关注网易云信 GitHub: