当前位置:网站首页>Aurora im live chat
Aurora im live chat
2022-06-11 05:35:00 【Cockroach bully BBQ】
I have been busy for more than a month , Have been doing app Integrate and improve the real-time chat function , It is hereby recorded that ...
I have used the real-time chat of Huanxin before , It has to be said that Huanxin did a good job , One easyUi Can let you comfortably concentrate on writing other , But because of the charge , So this time, listen to our products and use the free aurora im ~.~
1. First of all, I don't have to say Register for Aurora im Account number appk And so on Then paste the required permissions and configuration files into your own Manifest in If you need to modify it, remember to modify it and call it your own .
2. Import Aurora im Online library for I use these two
compile 'cn.jiguang.sdk:jmessage:2.9.0' ;compile 'cn.jiguang.sdk:jcore:2.0.0';
3. Initialize Aurora
JMessageClient.setDebugMode(true); JMessageClient.init(this);
4. Many say , Because instant chat relies on long links , That is commonly known as the breath link , therefore , All those who rely on the aurora function must log in !!! Keep in mind that ( If you don't use it for a long time, Aurora im It's going to drop ).
5,. Register Aurora account You can do it at the front desk , You can also do it backstage , It is usually done backstage , Because it is necessary to collect users ~ If you register at the front desk, Aurora provides registration api
6, Sign in ditto
7, Send a message , The aurora sends messages to message This object , Then, you can modify this object to send text 、 picture 、 Functions such as custom messages .
8, Get a message , As long as you write
// Register to receive message events JMessageClient.registerEventReceiver(this);
This function You can go to onevent Various offline data are obtained from the callback , Online messages ~
9, Chat history Take... From the following object ! uninstall APP Words , History will disappear with it ~
mConv = JMessageClient.getSingleConversation(username);
if (mConv != null) {
Log.e("mConv", "mConv There is ");
} else {
mConv = Conversation.createSingleConversation(username);
}10, This is required for instant message notification clicks receiver
public class NotificationClickEventReceiver {
private Context mContext;
public NotificationClickEventReceiver(Context context) {
mContext = context;
// Register to receive message events
JMessageClient.registerEventReceiver(this);
}
public void onEvent(MessageEvent event) {
Intent intent = new Intent();
intent.setAction("refalsh");
mContext.sendBroadcast(intent);
}
public void onEvent(NotificationClickEvent notificationClickEvent) {
if (null == notificationClickEvent) {
return;
}
Message msg = notificationClickEvent.getMessage();
if (msg != null) {
final UserInfo info = msg.getFromUser();
JMessageClient.getUserInfo(info.getUserName(), new GetUserInfoCallback() {
@Override
public void gotResult(int i, String s, final UserInfo userInfo) {
// Click... In the message notification bar doing
}
});
}
}
}No matter how small the details are over
边栏推荐
- Deep search + backtracking
- Es IK installation error
- Basics of customized view
- PageHelper page 2 collections in the same interface
- Zed2 camera calibration -- binocular, IMU, joint calibration
- 使用acme.sh自动申请免费SSL证书
- QT Road (1) -- Introduction to pro file
- 截取文件扩展名
- Flask develops and implements the like comment module of the online question and answer system
- 27. Remove elements
猜你喜欢

微信小程序,购买商品属性自动换行,固定div个数,超出部分自动换行

SQLite installation and configuration tutorial +navicat operation

Analysis while experiment - a little optimization of memory leakage in kotlin

【入门级基础】Node基础知识总结

Restoration of binary tree -- number restoration

Exploration of kangaroo cloud data stack on spark SQL optimization based on CBO

Linked list de duplication

Deep learning distributed training

BERT知识蒸馏

Es IK installation error
随机推荐
Manually splicing dynamic JSON strings
QT Road (2) -- HelloWorld
Wxparse parsing iframe playing video
Section II: structural composition characteristics of asphalt pavement (2) structural layer and performance requirements
微信自定义组件---样式--插槽
Wechat applet, automatic line feed for purchasing commodity attributes, fixed number of divs, automatic line feed for excess parts
About custom comparison methods of classes and custom methods of sort functions
1. use alicloud object OSS (basic)
JVM tuning V: JVM tuning tools and tuning practice
Swap numbers (no temporary variables)
JVM tuning 6: GC log analysis and constant pool explanation
Opencv learning path (2-2) -- Deep parsing namedwindow function
es-ik 安装报错
BERT知识蒸馏
(十五)红外通信
49. 字母异位词分组
mysql字符串转数组,合并结果集,转成数组
ReferenceError: server is not defined
wxParse解析iframe播放视频
English digital converter