I am trying to create 1 to 1 chat from a web client.
I downloaded the SDK and the group chat example. There seem to be really good examples for all platforms except the web.
(for example: http://quickblox.com/developers/Android_XMPP_Chat_Sample)
Can anyone provide code/example/directions?
Am i missing something or is the documentation for the web is really lacking?
Thanks
I suggest that you might see the 405 error because you have put the call of sendMessage function immediately after the call of connectChat function.
To connect to the chat needs some time, so you can not send the message until your client (browser) hasn't finished the connecting to the chat server at first. You need to put the call of sendMessage function in callback from function connectChat where a status is "Connected". Or you can perform sendMessage function on an onclick event to the tag
<button>
or something else. For your example, insert sendMessage like here:Starting from today QuickBlox has a own Web XMPP Chat plugin for WebSDK. You can look here the new example for 1:1 Chat which uses this library: http://quickblox.com/developers/Web_XMPP_Chat_Sample
The WebSDK is enough new. And we work on its documentation. But,here, I will show you some code snippets how you can create one to one chat.
As you know QuickBlox uses XMPP-server as a Chat service. WebSDK doesn't have a wrapper around XMPP API, so you should include additional XMPP JS library.
For our examples, we recommended to use Strophe.js (http://strophe.im/strophejs/)
Let's begin:
1) Include your xmpp js library and WebSDK
2) Describe your QB credentials
3) Create QB session with user authentication
4) Connect to QuickBlox Chat server with your user JID and password (http://quickblox.com/developers/Chat#Connecting_to_server)
5) Function for receive messages
6) Function for send messages
I'm sure, that it helps you to create one to one chat with QuickBlox using Javascript. If you want to use the group chat, you can look at 'Chat module code' from develop branch of Web XMPP chat sample: https://github.com/QuickBlox/sample-chat-xmpp-web/blob/develop/qbchatroom.js
Today we finished new sample's design http://i.imgur.com/r8CSdNV.png and very soon will deploy that to production.