Top

Bug when retrieving IMMessage Jid on Android Rainbow Messaging SDK

Commentaires

3 commentaires

  • Commentaire officiel
    Jérôme Gully

    Hi, sorry for the time to answer !

    When you chat (sent and recieve IMMessage directly), messages sent by you have your Jid and messages recieves from the other contact have the Jid of the contact. When you retrieve IMMessage of a conversation from history (mam), all IMMessage have the Jid of the contact associated with the Conversation.

    You can retrieve if the IMMessage is from you with "imMessage.isMsgSent()"

    Maybe in the future we will update this behavior to always have the right Jid.

    Actions pour les commentaires Permalien
  • Juan Antonio Garcia

    Hello, I had the same problem and I was able to solve it in android using the method "imMessage.isMsgSent()", however I am also doing the same development on iOS and I have encountered the same problem, but in this case the "message" object does not have a "isMsgSent method.

    How could I fix it with the iOS SDK?

    0
    Actions pour les commentaires Permalien
  • Vincent CHANN

    Hi @Juan Antonio Garcia,

    On Android I have found a way to know if the message is from the account you are currently connected with, or from the other person you talk with in the conversation.
    When you retrieve the array of IMMessage, each IMMessage has a deliveryState "immessage.deliveryState" :

    public static enum DeliveryState {

    // message from the account you are currently connected with
    SENT,
    TO_RESENT,
    SENT_SERVER_RECEIVED,
    SENT_CLIENT_RECEIVED,
    SENT_CLIENT_READ,
    // message from the other person you talk with in the conversation
    RECEIVED,
    READ,

    // unknown
    UNKNOWN;
    }
    0
    Actions pour les commentaires Permalien

Vous devez vous connecter pour laisser un commentaire.

  • Demandez à la Communauté

    Vous avez besoin d'aide? Posez vos questions à la Communauté et obtenez des réponses d'autres utilisateurs Rainbow.

    Poster un message