Commit 3d774149 by 王文龙

[update]更新版本 1.0.2.38

parent 4c80caf6
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="CompilerConfiguration">
<bytecodeTargetLevel target="11" />
</component>
</project>
\ No newline at end of file
<?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_11" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/build/classes" />
</component>
<component name="ProjectType">
......
......@@ -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" />
......
......@@ -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
......@@ -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;
......
-- "a/~$IMSDK\346\226\207\346\241\243_Android.doc"
++ /dev/null
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment