diff --git a/app/src/main/java/com/shayu/phonelive/AppContext.java b/app/src/main/java/com/shayu/phonelive/AppContext.java index 192cab2..c1f1fe2 100644 --- a/app/src/main/java/com/shayu/phonelive/AppContext.java +++ b/app/src/main/java/com/shayu/phonelive/AppContext.java @@ -284,10 +284,25 @@ public class AppContext extends CommonAppContext { if (message.getReceivedStatus().isRead()) { return false; } - MessageChatNotifyManager.getInstance().push(AppManager.getInstance().getLastActivity() - , message.getTargetId(), - content.getContent() - ); + + RongIMClient.getInstance().getUnreadCount(Conversation.ConversationType.PRIVATE, message.getTargetId(), new RongIMClient.ResultCallback() { + @Override + public void onSuccess(Integer integer) { + if (integer > 0) { + MessageChatNotifyManager.getInstance().push(AppManager.getInstance().getLastActivity() + , message.getTargetId(), + content.getContent() + ); + } + } + + @Override + public void onError(RongIMClient.ErrorCode e) { + + } + }); + + } } } catch (Exception e) {