twilio / twilio-chat-js-cordova-example

Cordova app example for Twilio Programmable Chat with working iOS and Android push messages
https://www.twilio.com/chat
8 stars 12 forks source link

How to send chat message after login #2

Closed devotebest closed 4 years ago

devotebest commented 5 years ago

I got login success. I want to send message to cordova app user. Could you help how to send message?

aleksandrsivanovs commented 5 years ago

Hi!

Since this is the Programmable Chat JS SDK wrapped to Cordova plugin you should follow the documentation we are publishing for JS SDK. Here is the link to latest available JS SDK: http://media.twiliocdn.com/sdk/js/chat/releases/3.2.3/docs/

Aleksandrs

devotebest commented 5 years ago

@aleksandrsivanovs thanks for your message. but I can't find document about "create channel", "send message", "receive message"

I will be very happy if you send link for that reference. thanks

aleksandrsivanovs commented 5 years ago

create channel: http://media.twiliocdn.com/sdk/js/chat/releases/3.2.3/docs/Client.html#createChannel__anchor send message: http://media.twiliocdn.com/sdk/js/chat/releases/3.2.3/docs/Channel.html#sendMessage__anchor

and receiving it happening via the getMessages (pull model): http://media.twiliocdn.com/sdk/js/chat/releases/3.2.3/docs/Channel.html#getMessages__anchor or via messageAdded event (event-based model): http://media.twiliocdn.com/sdk/js/chat/releases/3.2.3/docs/Channel.html#event:messageAdded__anchor

we also have some quickstart to get started with Twilio Programmable Chat: https://www.twilio.com/docs/chat/javascript/quickstart