• Stars
    star
    125
  • Rank 286,335 (Top 6 %)
  • Language
    JavaScript
  • Created about 7 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

React Demo(WebIM)介绍

更新时间:2023-04-10


新增群组Mentions 功能, 使用Antd Mentions组件

实现方案:

文本消息新增扩展字段em_at_list, 表示被@的用户ID,

  • 'ALL' 表示@所有人
  • ['userId', 'userId2'] 表示@指定用户
const MENTION_ALL = 'ALL';
let mentionList = ['userId', 'userId1'];
let isMentionALl = true

let txt = {
	to: 'groupId',
	chatType: 'groupChat',
	msg: '@user 你好',
	type: 'txt',
	ext: {
		em_at_list: isMentionALl ? MENTION_ALL : atList
	}
}

收到文本消息, 如扩展字段包含em_at_list则表示为@消息, 如果em_at_list包含当前用户,则进行UI更新

// onTextMessage回调中
let mentionList = message?.ext?.em_at_list
// 如果存在mentionList, 并且不是当前用户多端同步的消息
if(mentionList && message.from !== WebIM.conn.user){
	// 如果是@所有人或者mentionList包含当前用户ID
	if(mentionList === MENTION_ALL || mentionList.includes(WebIM.conn.user)){
		// 则进行UI更新
	}
}

更新时间:2022-07-15


环信即时通讯 WEB 端提供示例应用可供体验。为方便体验,建议使用你自己的 Demo 应用,具体步骤如下:

  1. 环信即时通讯云 IM 管理后台 通过邮箱注册,可以看到默认的 Demo 应用(默认应用是全功能开通的应用);

  2. 在上图页面 Demo 应用右侧点击 查看,选择 开放注册

img

  1. 打开 Demo,点击 服务器配置

  2. 将 Demo 的 App Key 填入,点击 保存配置

  3. 然后点击 注册用户 进行体验。

注意

注册模式分两种,开放注册和授权注册。只有开放注册时,才可以客户端注册。

  • 开放注册是为了测试使用,正式环境中不推荐使用该方式注册环信账号;
  • 授权注册的流程应该是你的应用服务器通过环信提供的 REST API 注册,之后将 token 保存到你的应用服务器或返回给客户端。

代码下载

欢迎大家提交 PR 改进和修复 WebIM 中的问题。

运行 WebIM 工程

IM SDK 及 Demo 下载 下载 WEB SDK 压缩包,然后解压。解压后在 demo 文件夹下,即为 WebIM 的工程目录。

  1. 初始化安装

    • 在/demo下执行 npm install
  2. 运行demo

主要模块介绍

Demo 中有几大模块

  • components —— 项目中定义的组件
  • config —— SDK 初始化配置
  • containers —— 容器组件,包含 contact, chat, login/regester
  • layout —— chat 部分的布局
  • selectors —— 缓存数据,优化性能
  • utils —— 数据库和工具方法

More Repositories

1

emchat-server-examples

PHP
523
star
2

web-im

环信 web im sdk
JavaScript
353
star
3

sdkdemoapp3.0_android

Java
312
star
4

easeui

Java
292
star
5

im_flutter_sdk

环信im flutter sdk, example中包含ui代码.
Dart
237
star
6

webim-weixin-xcx

JavaScript
200
star
7

webim-react-native

JavaScript
194
star
8

sdkdemoapp3.0_ios

Objective-C
144
star
9

webim-vue-demo

Easemob webim demo built on top of vue from scratch.
JavaScript
109
star
10

kefu-android-demo

demo app for help desk cloud
Java
94
star
11

sdk-ios-cocoapods

环信iOS SDK CocoaPod repo
Objective-C
78
star
12

webim-uniapp-demo

Vue
77
star
13

chat-android

Java
74
star
14

easeui_ios

Objective-C
74
star
15

livestream_demo_android

Java
69
star
16

kefu-ios-demo

demo app for easemob help desk cloud
Objective-C
53
star
17

livestream_demo_ios

直播demo iOS
Objective-C
49
star
18

kefu-webim

JavaScript
41
star
19

easeui-ios-hyphenate-cocoapods

cocoapods for Hyphenate EaseUI
Objective-C
35
star
20

SwallowKeeper

The description of the repo.
Python
34
star
21

easemob-demo-ios

Swift
22
star
22

easemob-im-server-sdk

IM server SDK
Java
20
star
23

videocall-android

Java
18
star
24

sdk-ios-cocoapods-integration

Objective-C
18
star
25

sdkdemoapp_windows

Windows demo
JavaScript
15
star
26

Circle-Demo-Web

JavaScript
13
star
27

www.easemob.com

环信
HTML
12
star
28

easemob_supercommunity

Java
11
star
29

easemob-demo-appserver

IM app-server.
Java
10
star
30

easecallkitui-android

Java
9
star
31

easemob-uikit-react

TypeScript
9
star
32

mua

Java
8
star
33

liveroom-android

Java
7
star
34

medical_treatment_demo

Vue
6
star
35

EasemobVoice

Java
6
star
36

easeui-ios-cocoapods

Objective-C
5
star
37

ease_call_kit

Easemob Callkit
Dart
5
star
38

emclient-unity

C#
5
star
39

Easemob2023-Innovation-Challenge

JavaScript
5
star
40

easemob-uikit-ios

Swift
5
star
41

learn-easemob

JavaScript
5
star
42

whiteboard_demo_web

JavaScript
4
star
43

kefu-agent-android

The description of the repo.
Java
4
star
44

easemob-push-server-sdk

Java
4
star
45

flutter_chat_uikit

Dart
4
star
46

videocall-web

JavaScript
4
star
47

EasemobCircle-2022-Innovation-Challenge

JavaScript
4
star
48

easemob-doc

Shell
3
star
49

easecallkitui-ios

Objective-C
3
star
50

Creative-Challenge-MQTT

MQTT challenge
3
star
51

kefu-agent-ios

The description of the repo.
Objective-C
3
star
52

voiceroom_demo_android

Java
2
star
53

easemob-demo-android

Kotlin
2
star
54

liveroom-ios

Objective-C
2
star
55

UIKit_Chatroom_ios

Swift
2
star
56

easemob-007-token

Java
2
star
57

easemob-support

Vue
2
star
58

UIKit_Chatroom_android

Kotlin
2
star
59

easemob-uikit-flutter

Dart
2
star
60

react-native-chat-sdk

TypeScript
2
star
61

easemob-uikit-reactnative

TypeScript
2
star
62

voiceroom_demo_ios

Swift
1
star
63

im-php-server-sdk

PHP Server SDK for IM.
PHP
1
star
64

easemob_flutter_chat

Flutter chat demo.
Dart
1
star
65

emclient-u3d

u3d sdk for Easemob IM
Objective-C
1
star
66

kefu-scripts

2023年4月4日已迁移至gitlab上
Shell
1
star
67

easemob-voiceroom

Java
1
star
68

livestream-demo-app-server

Java
1
star
69

docs

官网上的文档网站
PHP
1
star
70

Circle-Demo-Android

Java
1
star
71

kefu-vec-webim

JavaScript
1
star
72

whiteboard_demo_android

Java
1
star
73

videocall-ios

Objective-C
1
star
74

UIKit_Chatroom_flutter

Dart
1
star
75

UIKit_Chatroom_rn

TypeScript
1
star
76

Demo-ChattyAI

Java
1
star
77

flutter_chat_callkit

Dart
1
star
78

easemob-uikit-android

Kotlin
1
star