Package io.rong.imkit.manager

## Class UnReadMessageManager

- All Implemented Interfaces:

      public class UnReadMessageManager

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `public interface` | `UnReadMessageManager.IUnReadMessageObserver` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---

  - ### Enum Constant Summary

    Enum Constants
    Enum Constant | Description
    --- | ---

  - ### Method Summary

    Modifier and Type | Method | Description
    --- | --- | ---
    `static UnReadMessageManager` | `getInstance()` |
    `void` | `onSyncConversationReadStatus(ConversationType type, String targetId)` |
    `boolean` | `onReceived(Message message, int left, boolean hasPackage, boolean offline)` |
    `void` | `addObserver(Array<ConversationType> conversationTypes, UnReadMessageManager.IUnReadMessageObserver observer)` | 设置未读消息数变化监听器。 注意:如果是在 activity 中设置,那么要在 activity 销毁时, 调用 removeObserver 否则会造成内存泄漏。
    `void` | `addForeverObserver(Array<ConversationType> conversationTypes, UnReadMessageManager.IUnReadMessageObserver observer)` | 设置未读消息数变化监听器。 注意:如果是在 activity 中设置,那么要在 activity 销毁时, 调用 removeObserver 否则会造成内存泄漏。
    `void` | `removeObserver(UnReadMessageManager.IUnReadMessageObserver observer)` |
    `void` | `removeForeverObserver(UnReadMessageManager.IUnReadMessageObserver observer)` |
    `void` | `clearObserver()` |
    `void` | `clearForeverObserver()` |

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

  - ### Method Detail

    - #### getInstance

           static UnReadMessageManager getInstance()

    - #### onSyncConversationReadStatus

           void onSyncConversationReadStatus(ConversationType type, String targetId)

    - #### onReceived

           boolean onReceived(Message message, int left, boolean hasPackage, boolean offline)

    - #### addObserver

           void addObserver(Array<ConversationType> conversationTypes, UnReadMessageManager.IUnReadMessageObserver observer)

      设置未读消息数变化监听器。 注意:如果是在 activity 中设置,那么要在 activity 销毁时, 调用 removeObserver 否则会造成内存泄漏。

      Parameters:
        `conversationTypes` - 接收未读消息的会话类型。
        `observer` - 接收未读消息消息的监听器。

    - #### addForeverObserver

           void addForeverObserver(Array<ConversationType> conversationTypes, UnReadMessageManager.IUnReadMessageObserver observer)

      设置未读消息数变化监听器。 注意:如果是在 activity 中设置,那么要在 activity 销毁时, 调用 removeObserver 否则会造成内存泄漏。

      Parameters:
        `conversationTypes` - 接收未读消息的会话类型。
        `observer` - 接收未读消息消息的监听器。

    - #### removeObserver

           void removeObserver(UnReadMessageManager.IUnReadMessageObserver observer)

    - #### removeForeverObserver

           void removeForeverObserver(UnReadMessageManager.IUnReadMessageObserver observer)

    - #### clearObserver

           void clearObserver()

    - #### clearForeverObserver

           void clearForeverObserver()