Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

How to get users id to send message while chatting.

$
0
0

Hi All,

I am new to this ACS service. I am trying to made chat functionality. I have done as per the suggestion suggested on Ti docs.

Cloud.Chats.create({
    to_ids: ids.join(','),
    message: 'Good morning'
}, function (e) {
    if (e.success) {
        for (var i = 0; i < e.chats.length; i++) {
            var chat = e.chats[i];
            alert('Success:\n' +
                'From: ' + chat.from.first_name + ' ' + chat.from.last_name + '\n' +
                'Updated: ' + chat.updated_at + '\n' +
                'Message: ' + chat.message);
        }
    } else {
        alert('Error:\n' +
            ((e.error && e.message) || JSON.stringify(e)));
    }
});
But my question is, if I want to send message to someone, from where, I will get their id as I need to add them on the field 'to_ids' on above code block.

Please suggest...


Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>