修复
This commit is contained in:
parent
1e91f4c716
commit
67cca1b4fb
@ -34,6 +34,7 @@ import com.tencent.imsdk.v2.V2TIMSimpleMsgListener;
|
||||
import com.tencent.imsdk.v2.V2TIMUserInfo;
|
||||
import com.umeng.analytics.MobclickAgent;
|
||||
import com.umeng.commonsdk.UMConfigure;
|
||||
import com.yalantis.ucrop.UCropActivity;
|
||||
import com.yunbao.common.BuildConfig;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.CommonAppContext;
|
||||
@ -266,6 +267,7 @@ public class AppContext extends CommonAppContext {
|
||||
MessageChatNotifyManager.getInstance().addShieldClass(EntryActivity.class);
|
||||
MessageChatNotifyManager.getInstance().addShieldClass(LoginActivity.class);
|
||||
MessageChatNotifyManager.getInstance().addShieldClass(RegisterActivity.class);
|
||||
MessageChatNotifyManager.getInstance().addShieldClass(UCropActivity.class);
|
||||
|
||||
|
||||
RongcloudIMManager.addRongcloudIMOnReceiveMessageListener(new RongIMClient.OnReceiveMessageWrapperListener() {
|
||||
|
@ -31,7 +31,7 @@ public abstract class ImageResultCallback {
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
listener.onItemClick(null, -1);
|
||||
listener.onItemClick(error, -1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ public class MessageIMManager {
|
||||
ToastUtil.showDebug(e.getMessage());
|
||||
}
|
||||
});
|
||||
|
||||
getSystemMessages();
|
||||
}
|
||||
|
||||
public MessageIMManager setSystemNumber(int systemNumber) {
|
||||
@ -126,7 +126,7 @@ public class MessageIMManager {
|
||||
* 获取系统消息(有未读数展示红点)
|
||||
*/
|
||||
public void getSystemMessages() {
|
||||
systemNumber = 0;
|
||||
|
||||
IMLoginModel userInfo = IMLoginManager.get(mContext).getUserInfo();
|
||||
if (userInfo == null) {
|
||||
return;
|
||||
@ -138,6 +138,7 @@ public class MessageIMManager {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
systemNumber = 0;
|
||||
List<IMLoginModel> listUserBean = JSON.parseArray(Arrays.toString(info), IMLoginModel.class);
|
||||
if (listUserBean != null && listUserBean.size() >= 2) {
|
||||
//目前就三条消息,需求判断前两条消息是否有未读消息
|
||||
@ -217,7 +218,7 @@ public class MessageIMManager {
|
||||
//整合未读消息数目并且发送出去
|
||||
private final Runnable essagesRunnable = () -> {
|
||||
number = imNumber + systemNumber;
|
||||
/*if(AppManager.getInstance().getMainActivity()==null){
|
||||
/* if(AppManager.getInstance().getMainActivity()==null){
|
||||
new Handler(Looper.getMainLooper()).postDelayed(() -> {
|
||||
DebugDialog.getInstance(AppManager.getInstance().getMainActivity()).setParams("消息", imNumber + "");
|
||||
DebugDialog.getInstance(AppManager.getInstance().getMainActivity()).setParams("系統", systemNumber + "");
|
||||
@ -227,7 +228,7 @@ public class MessageIMManager {
|
||||
DebugDialog.getInstance(AppManager.getInstance().getMainActivity()).setParams("系統", systemNumber + "");
|
||||
}*/
|
||||
Log.i("未读消息", "消息: "+imNumber+" | 系统: "+systemNumber);
|
||||
EventBus.getDefault().post(new MessageIMEvent().setNumber(number).setMessage(imNumber));
|
||||
EventBus.getDefault().post(new MessageIMEvent().setNumber(imNumber).setMessage(imNumber));
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -119,7 +119,7 @@ public class RongcloudIMManager {
|
||||
*/
|
||||
public static void connectIM(Context context) {
|
||||
// MessageIMManager.get(context).addImRongCloudObserver();
|
||||
MessageIMManager.get(context).getSystemMessages();
|
||||
// MessageIMManager.get(context).getSystemMessages();
|
||||
IMLoginModel userInfo = IMLoginManager.get(context).getUserInfo();
|
||||
String IMToken = userInfo.getTokenRong();
|
||||
Log.e(CLASSNAME, "connectIM:" + IMToken);
|
||||
|
@ -235,6 +235,7 @@ public class MainActivity extends AbsActivity implements MainAppBarLayoutListene
|
||||
.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
// DebugDialog.getInstance(mContext).setParams("测试版本","1.00");
|
||||
ConversationIMListManager.get(mContext).addUserInfoProvider();
|
||||
MessageIMManager.get(mContext).resetImUnReadMessageCount(mContext);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user