This commit is contained in:
18401019693 2022-07-26 13:14:43 +08:00
parent 69ad6efb65
commit 1b53016056
5 changed files with 14 additions and 30 deletions

View File

@ -26,6 +26,7 @@ import com.tencent.imsdk.v2.V2TIMUserInfo;
import com.yunbao.common.BuildConfig; import com.yunbao.common.BuildConfig;
import com.yunbao.common.CommonAppContext; import com.yunbao.common.CommonAppContext;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.manager.imrongcloud.MessageIMManager;
import com.yunbao.common.manager.imrongcloud.RongcloudIMManager; import com.yunbao.common.manager.imrongcloud.RongcloudIMManager;
import com.yunbao.common.http.CommonHttpUtil; import com.yunbao.common.http.CommonHttpUtil;
import com.yunbao.common.http.HttpCallback; import com.yunbao.common.http.HttpCallback;
@ -160,6 +161,7 @@ public class AppContext extends CommonAppContext {
@Override @Override
public boolean onReceived(io.rong.imlib.model.Message message, int i, boolean b, boolean b1) { public boolean onReceived(io.rong.imlib.model.Message message, int i, boolean b, boolean b1) {
Log.e("wewe", message.getConversationType() + "112121"); Log.e("wewe", message.getConversationType() + "112121");
MessageIMManager.get(sInstance).getSystemForRongcloud(message);
//融云直播间聊天 //融云直播间聊天
Message msg = Message.obtain(); Message msg = Message.obtain();
msg.what = Constants.SOCKET_WHAT_BROADCAST; msg.what = Constants.SOCKET_WHAT_BROADCAST;

View File

@ -131,6 +131,7 @@ public class IMLoginManager extends BaseCacheManager {
String[] uidAndToken = SpUtil.getInstance().getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN}); String[] uidAndToken = SpUtil.getInstance().getMultiStringValue(new String[]{SpUtil.UID, SpUtil.TOKEN});
String uid = uidAndToken[0]; String uid = uidAndToken[0];
String token = uidAndToken[1]; String token = uidAndToken[1];
if (TextUtils.isEmpty(token)) return;
HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo") HttpClient.getInstance().get("User.getBaseInfos", "getBaseInfo")
.params("uid", uid) .params("uid", uid)
.params("token", token) .params("token", token)

View File

@ -9,9 +9,9 @@ ext {
] ]
manifestPlaceholders = [ manifestPlaceholders = [
// //
// serverHost : "https://napi.yaoulive.com", serverHost : "https://napi.yaoulive.com",
// //
serverHost : "https://ceshi.yaoulive.com", // serverHost : "https://ceshi.yaoulive.com",
// //
txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB", txMapAppKey : "EOZBZ-ASLCU-4XPV3-BDCHZ-4E3Q7-H4BWB",

View File

@ -42,9 +42,9 @@ import com.yunbao.common.activity.AbsActivity;
import com.yunbao.common.adapter.ViewPagerAdapter; import com.yunbao.common.adapter.ViewPagerAdapter;
import com.yunbao.common.bean.ChatRemarksBean; import com.yunbao.common.bean.ChatRemarksBean;
import com.yunbao.common.bean.ConfigBean; import com.yunbao.common.bean.ConfigBean;
import com.yunbao.common.bean.IMLoginModel;
import com.yunbao.common.bean.LiveSvgGiftBean; import com.yunbao.common.bean.LiveSvgGiftBean;
import com.yunbao.common.bean.UpdataListBean; import com.yunbao.common.bean.UpdataListBean;
import com.yunbao.common.bean.UserBean;
import com.yunbao.common.custom.TabButtonGroup; import com.yunbao.common.custom.TabButtonGroup;
import com.yunbao.common.event.MessageIMEvent; import com.yunbao.common.event.MessageIMEvent;
import com.yunbao.common.event.RongIMConnectionStatusEvent; import com.yunbao.common.event.RongIMConnectionStatusEvent;
@ -66,11 +66,7 @@ import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.VersionUtil; import com.yunbao.common.utils.VersionUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.views.AbsMainViewHolder; import com.yunbao.common.views.AbsMainViewHolder;
import com.yunbao.live.LiveConfig;
import com.yunbao.live.activity.LiveAnchorActivity;
import com.yunbao.live.activity.LiveRyAnchorActivity;
import com.yunbao.live.bean.LiveBean; import com.yunbao.live.bean.LiveBean;
import com.yunbao.live.bean.LiveKsyConfigBean;
import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpConsts;
import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.utils.LiveStorge; import com.yunbao.live.utils.LiveStorge;
@ -83,7 +79,6 @@ import com.yunbao.main.event.PDLiveConversationListEvent;
import com.yunbao.main.http.MainHttpConsts; import com.yunbao.main.http.MainHttpConsts;
import com.yunbao.main.http.MainHttpUtil; import com.yunbao.main.http.MainHttpUtil;
import com.yunbao.main.interfaces.MainAppBarLayoutListener; import com.yunbao.main.interfaces.MainAppBarLayoutListener;
import com.yunbao.main.interfaces.MainStartChooseCallback;
import com.yunbao.main.manager.imrongcloud.ConversationIMListManager; import com.yunbao.main.manager.imrongcloud.ConversationIMListManager;
import com.yunbao.main.presenter.CheckLivePresenter; import com.yunbao.main.presenter.CheckLivePresenter;
import com.yunbao.main.utils.GenerateTestUserSig; import com.yunbao.main.utils.GenerateTestUserSig;
@ -361,9 +356,8 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
//初始化腾讯im //初始化腾讯im
private void initTXIM() { private void initTXIM() {
//登录腾讯云服务器 //登录腾讯云服务器
final CommonAppConfig appConfig = CommonAppConfig.getInstance(); CommonAppConfig.getInstance();
final UserBean u = appConfig.getUserBean(); IMLoginModel userInfo = IMLoginManager.get(this).getUserInfo();
// 1. IM 控制台获取应用 SDKAppID详情请参考 SDKAppID // 1. IM 控制台获取应用 SDKAppID详情请参考 SDKAppID
// 2. 初始化 config 对象 // 2. 初始化 config 对象
V2TIMSDKConfig config = new V2TIMSDKConfig(); V2TIMSDKConfig config = new V2TIMSDKConfig();
@ -405,7 +399,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
super.onUserSigExpired(); super.onUserSigExpired();
Log.i("tx", "登录过期了"); Log.i("tx", "登录过期了");
V2TIMManager.getInstance().login(u.getId(), GenerateTestUserSig.genTestUserSig(u.getId()), new V2TIMCallback() { V2TIMManager.getInstance().login(userInfo.getId() + "", GenerateTestUserSig.genTestUserSig(userInfo.getId() + ""), new V2TIMCallback() {
@Override @Override
public void onSuccess() { public void onSuccess() {
Log.i("tx", "登录成功"); Log.i("tx", "登录成功");
@ -423,13 +417,13 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
}); });
//登录腾讯云服务器 //登录腾讯云服务器
V2TIMManager.getInstance().login(u.getId(), GenerateTestUserSig.genTestUserSig(u.getId()), new V2TIMCallback() { V2TIMManager.getInstance().login(userInfo.getId() + "", GenerateTestUserSig.genTestUserSig(userInfo.getId() + ""), new V2TIMCallback() {
@Override @Override
public void onSuccess() { public void onSuccess() {
Log.i("tx", "登录成功"); Log.i("tx", "登录成功");
V2TIMUserFullInfo v2TIMUserFullInfo = new V2TIMUserFullInfo(); V2TIMUserFullInfo v2TIMUserFullInfo = new V2TIMUserFullInfo();
v2TIMUserFullInfo.setNickname(u.getUserNiceName()); v2TIMUserFullInfo.setNickname(userInfo.getUserNicename());
v2TIMUserFullInfo.setFaceUrl(u.getAvatarThumb()); v2TIMUserFullInfo.setFaceUrl(userInfo.getAvatarThumb());
V2TIMManager.getInstance().setSelfInfo(v2TIMUserFullInfo, new V2TIMCallback() { V2TIMManager.getInstance().setSelfInfo(v2TIMUserFullInfo, new V2TIMCallback() {
@Override @Override
public void onError(int code, String desc) { public void onError(int code, String desc) {
@ -483,9 +477,6 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
} }
/** /**
* 检查版本更新 * 检查版本更新
*/ */

View File

@ -138,16 +138,6 @@ public class MainHomeLiveAdapter extends RefreshAdapter<LiveBean> {
super.onViewDetachedFromWindow(holder); super.onViewDetachedFromWindow(holder);
} }
// @Override
// public void onViewRecycled(@NonNull RecyclerView.ViewHolder holder) {
// //局部刷新周星榜svaga
// if (holder instanceof MainHomeLiveWeekItemViewHolder) {
// if (((MainHomeLiveWeekItemViewHolder) holder).weekSvga.isAnimating()) {
// ((MainHomeLiveWeekItemViewHolder) holder).weekSvga.stopAnimation();
// }
// }
// super.onViewRecycled(holder);
// }
@Override @Override
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder vh, int position) { public void onBindViewHolder(@NonNull RecyclerView.ViewHolder vh, int position) {