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"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <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" /> <output url="file://$PROJECT_DIR$/build/classes" />
</component> </component>
<component name="ProjectType"> <component name="ProjectType">
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<component name="RunConfigurationProducerService"> <component name="RunConfigurationProducerService">
<option name="ignoredProducers"> <option name="ignoredProducers">
<set> <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.AllInPackageGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" /> <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestClassGradleConfigurationProducer" />
<option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" /> <option value="org.jetbrains.plugins.gradle.execution.test.runner.TestMethodGradleConfigurationProducer" />
......
...@@ -90,7 +90,7 @@ dependencies { ...@@ -90,7 +90,7 @@ dependencies {
implementation 'com.tencent.bugly:nativecrashreport:latest.release' implementation 'com.tencent.bugly:nativecrashreport:latest.release'
// 中公IMSDK // 中公IMSDK
implementation("com.offcn.live:imsdk-kit:1.0.2.23") implementation("com.offcn.live:imsdk-kit:1.0.2.38")
// 中公IM基础库,业务需要 // 中公IM基础库,业务需要
implementation("com.offcn.live:base:2.5.0-s18") 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; ...@@ -15,6 +15,7 @@ import com.offcn.live.im.bean.OIMMsg;
import com.offcn.live.im.bean.OIMUserInfo; import com.offcn.live.im.bean.OIMUserInfo;
import com.offcn.live.im.util.OIMDataManager; import com.offcn.live.im.util.OIMDataManager;
import com.offcn.live.im.util.ZGLLogUtils; import com.offcn.live.im.util.ZGLLogUtils;
import com.offcn.live.imkit.OIMKitSDK;
import com.tencent.bugly.crashreport.CrashReport; import com.tencent.bugly.crashreport.CrashReport;
import androidx.multidex.MultiDex; import androidx.multidex.MultiDex;
...@@ -44,18 +45,24 @@ public class MyApp extends MultiDexApplication { ...@@ -44,18 +45,24 @@ public class MyApp extends MultiDexApplication {
} }
private void initOIMSDK() { private void initOIMSDK() {
// 初始化本地DB,用于存储用户信息。本示例数据直接由 MockData 提供
// UserBeanDaoManager.getInstance().init(this);
// 中公IM 初始化 // 中公IM 初始化
OIMSDK.init(this, mEnvIsTest); OIMSDK.init(this, mEnvIsTest);
// 始终打印log 方便调试------------------记得上线前关闭 // 中公IM 初始化UI相关配置
ZGLLogUtils.setLogEnabled(true); OIMKitSDK.init(this);
// 中公IM 监听新消息 // 打印log 方便调试------------------记得上线前关闭
ZGLLogUtils.setLogEnabled(BuildConfig.DEBUG);
// 中公IM 监听新消息。默认不用监听,如有需求要监听新消息,可实现此方法
OIMSDK.getInstance().setOnMsgListener(new OIMCallback.OnReceiveMsgListener() { OIMSDK.getInstance().setOnMsgListener(new OIMCallback.OnReceiveMsgListener() {
@Override @Override
public void onMsg(OIMMsg oimMsg) { public void onMsg(OIMMsg oimMsg) {
ZGLLogUtils.e(TAG, "onMsg 新消息"); 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 提供用户信息 // 中公IM 提供用户信息
...@@ -66,13 +73,14 @@ public class MyApp extends MultiDexApplication { ...@@ -66,13 +73,14 @@ public class MyApp extends MultiDexApplication {
return null; return null;
} }
// 从DB中获取到用户信息,返回给SDK // 获取用户信息,返回给SDK。建议外部DB存储用户信息
UserBean destUserBean = MockData.getUserById(s); UserBean destUserBean = MockData.getUserById(s);
if(destUserBean == null){ if (destUserBean == null) {
return null; return null;
} }
OIMUserInfo userInfo = new OIMUserInfo(); OIMUserInfo userInfo = new OIMUserInfo();
userInfo.setUser_id(destUserBean.getUser_id()); userInfo.setUser_id(destUserBean.getUser_id());
userInfo.setRemark("");
userInfo.setName(destUserBean.getName()); userInfo.setName(destUserBean.getName());
userInfo.setAvatar(destUserBean.getAvatar()); userInfo.setAvatar(destUserBean.getAvatar());
return userInfo; 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