Learn how to install QuickBlox SDK and send your first message.
QB
is created.
init()
method and pass the APPLICATION_ID
, AUTH_KEY
, AUTH_SECRET
, and ACCOUNT_KEY
as arguments to it.
params
variable. Call the createSession()
method and pass the params
as an argument to it using the code snippet below
userId
and password
fields in the userCredentials
. Call the connect()
method and pass the userCredentials
as an argument to it.
type
and occupants_ids
properties of the params
variable. Call the create()
method and pass the params
as an argument.
QB.chat.onMessageListener
you can monitor whether an incoming message is received from the QuickBlox server. Use the QB.chat.onMessageListener
to listen to all incoming messages.
message
variable and set the type
, body
, and extension
properties. Create opponentId
variable and set the ID of the user we are going to send a message to. Call the send()
method and pass the created message
and opponentId
as arguments to it.
save_to_history
parameter if you want this message to be saved in chat history.