当前位置:网站首页>Long awaited full platform support - Open Source im project uniapp update of openim
Long awaited full platform support - Open Source im project uniapp update of openim
2022-07-24 16:31:00 【InfoQ】

Offline plug-in mode
- Download the latestOffline plug-ins
- git clone https://github.com/OpenIMSDK/Open-IM-SDK-Uniapp.git
- Will download the
Tuoyun-OpenIMSDKPut the whole folder uniapp In the root directory of the projectnativepluginsUnder the folder ( If there is no such folder, create a new ).

- open uniapp Project root directory
manifest.jsonfile , openApp Native plug in configuration, Select local plug-ins to import .

- Introduce in the project SDK And listener .
- const openIM = uni.requireNativePlugin("Tuoyun-OpenIMSDK");
- const event = uni.requireNativePlugin("globalEvent");
-
- export { openIM,event }
- Project cloud packaging custom debugging base .

- Start custom debugging base
- You need to select the operation base asCustom debug base

Plug in market cloud plug-in mode
- stay dcloudPlug in marketby uniapp Project binding cloud plug-in .
- After selection, you need to bind the corresponding package name .

- open uniapp Project root directory
manifest.jsonfile , openApp Native plug in configuration, Select the cloud plug-in to import .

- The remaining steps are the sameOffline plug-in mode4-6.
initialization SDK
im.initSDK(operationID, { // operationID It is just a random string Used to locate problems
platform: Platform, // Platform number Refer to the general structure Platform
api_addr: "http://121.37.25.71:10002", // IM API Address
ws_addr: "ws://121.37.25.71:10001", // IM Ws Address
data_dir:"data_dir", // SDK Data storage directory ( Absolute path )
log_level: 6, // SDK The level of logging
object_storage: "minio", // Storage methods of resources such as pictures At present, we support "minio"、"cos"
});
Set listening
im.setUserListener(); // User related monitoring
im.setFriendListener(); // Friend related monitoring
im.setGroupListener(); // Group chat related monitoring
im.setAdvancedMsgListener(); // Message related listening
im.setConversationListener(); // Session related listening
Sign in IM
im.login(
operationID, // operationID It is just a random string Used to locate problems
userID, // user ID Pay attention to this. userID Want to be with token Medium userID Agreement
token, // user token Pay attention to this. token Medium platform To and initialize platform Agreement
(res) => {
if (res.errCode !== 0) {
// Login failed
} else {
// Login successful
}
}
);
Project results

OpenIM What is it?
边栏推荐
- VSCode如何鼠标滚轮放大界面
- Causes and solutions of QT signal and slot connection failure
- What does Baidu promote "delete and recall" mean?
- 【南京农业大学】考研初试复试资料分享
- With regard to performance testing, dry goods hit "suggestions collection"
- Envi SHP to ROI and mask the grid
- Qt键盘事件(一)——检测按键输入
- C TCP client form application asynchronous receiving mode
- Getting started with arcpy
- With notes: printing order of synchronous, asynchronous, micro task and macro task
猜你喜欢

.NET 测试框架 xUnit,MSTest, Specflow 使用经验汇总

Thinkphp3.2.5 cannot jump to external links

城市安全系列科普丨进入溺水高发期,救生常识话你知

Complete guide on how to prevent cross site scripting (XSS) attacks

1184. 公交站间的距离

Princeton calculus reader 02 Chapter 1 -- composition of functions, odd and even functions, function images

我们为什么要推出Getaverse?

ArcGIS layer annotation display

C# TCP客户端窗体应用程序异步接收方式

Rest style
随机推荐
Talk about C pointer
Jing Wei PS tutorial: basic part a
.NET 测试框架 xUnit,MSTest, Specflow 使用经验汇总
[leetcode] day102 spiral matrix II
My first blog
Enter a URL to this page to show it. What happened in this process?
Servlet framework (servlet+jsp) + addition, deletion, modification and query + paging implemented by MySQL (function package student information entry, addition, deletion, modification and query of st
'resultmap'must match' (constructor?, id*, result*, association*, collect problem solving
Envi5.3 open GF-1 WFV data
Jenkins cli command details
Mobile phone comparison redmi note8 and realm x2
leetcode:162. 寻找峰值【二分寻找峰值】
VSCode如何鼠标滚轮放大界面
随笔记:同步、异步和微任务、宏任务的打印顺序
Due to lack of funds, Changdian technology sold some assets of Xingke Jinpeng for 120million US dollars!
Huawei Kirin 985 mass production in the third quarter: TSMC 7Nm EUV process, integrated 5g baseband!
【技术】uniapp 之 在线选座 demo
QT design simulation robot controller
ZCMU--5083: ly的数对(C语言)
QT keyboard event (I) -- detect key input