一对一单聊,登录创建等一系列操作都正常,但是接收端收不到消息,不会调用onMessage()

按照文档我创建好了这两个类:

public static class CustomMessageHandler extends LCIMMessageHandler{
  /**
   * 重载此方法来处理接收消息
   * 
   * @param message
   * @param conversation
   * @param client
   */
   @Override
   public void onMessage(LCIMMessage message,LCIMConversation conversation,LCIMClient client){
     if(message instanceof LCIMTextMessage){
       Log.d(((LCIMTextMessage)message).getText()); // Jerry,起床了
     }
   }
 }


public class CustomConversationEventHandler extends LCIMConversationEventHandler {
  /**
   * 实现本方法来处理当前用户被邀请到某个聊天对话事件
   *
   * @param client
   * @param conversation 被邀请的聊天对话
   * @param operator 邀请你的人
   * @since 3.0
   */
  @Override
  public void onInvited(LCIMClient client, LCIMConversation conversation, String invitedBy) {
    // 当前 clientId(Jerry)被邀请到对话,执行此处逻辑
  }
}

并在 application 中,调用了下面的两个方法,但无法接收另一端发送过来的消息。

// 设置全局的对话事件处理 handler
LCIMMessageManager.setConversationEventHandler(new CustomConversationEventHandler());
// 设置全局的消息处理 handler
LCIMMessageManager.registerDefaultMessageHandler(new CustomMessageHandler());

您好,发送的消息是 LCIMTextMessage 类型吗?

您好,是的

接受端的 Client 是否执行过 open。可以开启调试日志,粘贴下完整的接收端的日志。

2022-09-21 14:34:13.596 20585-20585/com.example.todolist D/PushService: processIMRequests...
2022-09-21 14:34:13.596 20585-20585/com.example.todolist D/PushService: processIMRequestsFromClient...
2022-09-21 14:34:13.645 20585-20743/com.example.todolist D/LCConnectionManager: client(cn.leancloud.websocket.StandardWebSocketClient@874a2b6) downlink: cmd: loggedin
    installationId: "3a6e96754bcbcb96f564462bbad6aeba"
    service: 0
    loggedinMessage {
      pushDisabled: true
    }
2022-09-21 14:34:13.645 20585-20743/com.example.todolist I/LCConnectionManager: received close connection instruction from server.
2022-09-21 14:34:13.737 20585-20663/com.example.todolist D/LoggingInterceptor: Request: curl -X POST 
     -H Accept: application/json 
     -H Content-Type: application/json 
     -H User-Agent: LeanCloud-Java-SDK/8.2.5 
     -H X-LC-Id: dOjVkqsXENI7Xva3Yw5jSS6n-gzGzoHsz 
     -H X-LC-Prod: 1 
     -H X-LC-Sign: {your_sign} 
    -d '{"session_token":"tl6a8rt75et0hykw779h2ccgu"}' 
    https://dojvkqsx.lc-cn-n1-shared.com/1.1/rtm/sign
2022-09-21 14:34:13.739 20585-20663/com.example.todolist D/LoggingInterceptor: Response: 200 
    server: openresty
    date: Wed, 21 Sep 2022 06:34:14 GMT
    content-type: application/json;charset=utf-8
    vary: Accept-Encoding
    x-request-biztype: unknown
    cache-control: no-cache,no-store
    pragma: no-cache
    strict-transport-security: max-age=31536000
     
    {"signature":"edbd688acc4287e6ecab25bc43d3a663aef1575d","nonce":"k1n1ex1wtw","client_id":"63280bce6c306e6f83c06ee6","timestamp":1663742054295} 
2022-09-21 14:34:13.762 20585-20753/com.example.todolist D/StandardWebSocketClient: client(cn.leancloud.websocket.StandardWebSocketClient@874a2b6) uplink : cmd: session
    op: open
    peerId: "63280bce6c306e6f83c06ee6"
    i: -65535
    sessionMessage {
      t: 1663742054295
      n: "k1n1ex1wtw"
      s: "edbd688acc4287e6ecab25bc43d3a663aef1575d"
      ua: "LeanCloud-Java-SDK/8.2.5"
      deviceId: "3a6e96754bcbcb96f564462bbad6aeba"
      lastPatchTime: 1663732396635
      configBitmap: 175
    }

您好,依旧无法接收消息,请您帮忙看一看