简体   繁体   中英

Sinch API, Instant Messaging JS. Get all messages by senderID

I'm trying to get all messages by senderID.

onIncomingMessage: function(message) {
    // getAllMessagesBySenderId(); ?

    $('div#chatArea').prepend('<div class="msgRow" id="'+message.messageId+'"></div><div class="clearfix"></div>');

    $('div.msgRow#'+message.messageId)
        .attr('class', global_username == message.senderId ? 'me' : 'other')
        .append([
            '<div id="from">'+message.senderId+' <span>'+message.timestamp.toLocaleTimeString()+(global_username == message.senderId ? ',' : '')+'</span></div>', 
            '<div id="pointer"></div>',
            '<div id="textBody">'+message.textBody+'</div>',
            '<div class="recipients"></div>'
        ]);
    showUI();
}

Any ideas? Is it possible to get history of messages? I can't find anything about it in the documentation.

you would save that in your own data structure, Sinch IM does not provide the "inbox" we deliver the message once to every device. Sorry

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM