Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
IMSDK_Demo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王文龙
IMSDK_Demo
Commits
3d774149
Commit
3d774149
authored
Aug 11, 2021
by
王文龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[update]更新版本 1.0.2.38
parent
4c80caf6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
28 additions
and
11 deletions
+28
-11
compiler.xml
.idea/compiler.xml
+7
-0
misc.xml
.idea/misc.xml
+1
-1
runConfigurations.xml
.idea/runConfigurations.xml
+1
-0
build.gradle
app/build.gradle
+2
-1
MyApp.java
app/src/main/java/com/offcn/im/demo/MyApp.java
+16
-8
~$IMSDK文档_Android.doc
~$IMSDK文档_Android.doc
+1
-1
No files found.
.idea/compiler.xml
0 → 100644
View file @
3d774149
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"CompilerConfiguration"
>
<bytecodeTargetLevel
target=
"11"
/>
</component>
</project>
\ No newline at end of file
.idea/misc.xml
View file @
3d774149
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1
_8
"
project-jdk-name=
"1.8"
project-jdk-type=
"JavaSDK"
>
<component
name=
"ProjectRootManager"
version=
"2"
languageLevel=
"JDK_1
1"
default=
"true
"
project-jdk-name=
"1.8"
project-jdk-type=
"JavaSDK"
>
<output
url=
"file://$PROJECT_DIR$/build/classes"
/>
</component>
<component
name=
"ProjectType"
>
...
...
.idea/runConfigurations.xml
View file @
3d774149
...
...
@@ -3,6 +3,7 @@
<component
name=
"RunConfigurationProducerService"
>
<option
name=
"ignoredProducers"
>
<set>
<option
value=
"com.android.tools.idea.compose.preview.runconfiguration.ComposePreviewRunConfigurationProducer"
/>
<option
value=
"org.jetbrains.plugins.gradle.execution.test.runner.AllInPackageGradleConfigurationProducer"
/>
<option
value=
"org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer"
/>
<option
value=
"org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer"
/>
...
...
app/build.gradle
View file @
3d774149
...
...
@@ -90,7 +90,7 @@ dependencies {
implementation
'com.tencent.bugly:nativecrashreport:latest.release'
// 中公IMSDK
implementation
(
"com.offcn.live:imsdk-kit:1.0.2.
23
"
)
implementation
(
"com.offcn.live:imsdk-kit:1.0.2.
38
"
)
// 中公IM基础库,业务需要
implementation
(
"com.offcn.live:base:2.5.0-s18"
)
}
\ No newline at end of file
app/src/main/java/com/offcn/im/demo/MyApp.java
View file @
3d774149
...
...
@@ -15,6 +15,7 @@ import com.offcn.live.im.bean.OIMMsg;
import
com.offcn.live.im.bean.OIMUserInfo
;
import
com.offcn.live.im.util.OIMDataManager
;
import
com.offcn.live.im.util.ZGLLogUtils
;
import
com.offcn.live.imkit.OIMKitSDK
;
import
com.tencent.bugly.crashreport.CrashReport
;
import
androidx.multidex.MultiDex
;
...
...
@@ -44,18 +45,24 @@ public class MyApp extends MultiDexApplication {
}
private
void
initOIMSDK
()
{
// 初始化本地DB,用于存储用户信息。本示例数据直接由 MockData 提供
// UserBeanDaoManager.getInstance().init(this);
// 中公IM 初始化
OIMSDK
.
init
(
this
,
mEnvIsTest
);
// 始终打印log 方便调试------------------记得上线前关闭
ZGLLogUtils
.
setLogEnabled
(
true
);
// 中公IM 监听新消息
// 中公IM 初始化UI相关配置
OIMKitSDK
.
init
(
this
);
// 打印log 方便调试------------------记得上线前关闭
ZGLLogUtils
.
setLogEnabled
(
BuildConfig
.
DEBUG
);
// 中公IM 监听新消息。默认不用监听,如有需求要监听新消息,可实现此方法
OIMSDK
.
getInstance
().
setOnMsgListener
(
new
OIMCallback
.
OnReceiveMsgListener
()
{
@Override
public
void
onMsg
(
OIMMsg
oimMsg
)
{
ZGLLogUtils
.
e
(
TAG
,
"onMsg 新消息"
);
EventBusUtil
.
sendEvent
(
new
EventBusCenter
(
Constants
.
EventCode
.
Code_New_Msg
));
}
});
// 中公IM 监听未读总数变化
OIMSDK
.
getInstance
().
setOnUnreadMsgCountChangedListener
(
new
OIMCallback
.
OnUnreadMsgCountChangedListener
()
{
@Override
public
void
onCountChanged
(
int
i
)
{
ZGLLogUtils
.
e
(
TAG
,
"未读总数变化:"
+
i
);
}
});
// 中公IM 提供用户信息
...
...
@@ -66,13 +73,14 @@ public class MyApp extends MultiDexApplication {
return
null
;
}
//
从DB中获取到用户信息,返回给SDK
//
获取用户信息,返回给SDK。建议外部DB存储用户信息
UserBean
destUserBean
=
MockData
.
getUserById
(
s
);
if
(
destUserBean
==
null
)
{
if
(
destUserBean
==
null
)
{
return
null
;
}
OIMUserInfo
userInfo
=
new
OIMUserInfo
();
userInfo
.
setUser_id
(
destUserBean
.
getUser_id
());
userInfo
.
setRemark
(
""
);
userInfo
.
setName
(
destUserBean
.
getName
());
userInfo
.
setAvatar
(
destUserBean
.
getAvatar
());
return
userInfo
;
...
...
~$IMSDK文档_Android.doc
deleted
100644 → 0
View file @
4c80caf6
-- "a/~$IMSDK\346\226\207\346\241\243_Android.doc"
++ /dev/null
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment