Learn how to install QuickBlox SDK and send your first message.
Podfile
. Project dependencies should be managed by CocoaPods. Create this file in the same directory with your project.Podfile
and enter the following code lines into it. Specify the SDK version being installed.applicationID
, authKey
, authSecret
, and accountKey
. Add the code below to the AppDelegate file located in the root directory of your project:
logIn()
method and pass the user login and user password as arguments to it.
connect()
method and pass the user.id
and user.password
to it.
QBChatDialog
instance and set the dialogID
, type
, and occupantIDs
fields. Call the createDialog()
method and pass the dialog
to it as an argument.
addDelegate()
method to add a listener enabling the app to listen to the received messages. In other words, you subscribe to this event using chat delegate in your chat controller.
QBChatDelegate
methods you need in your chat controller.
QBChatMessage
instance. Set the text of the message. Call the send()
method and pass the message
as an argument to it.
save_to_history
parameter if you want this message to be saved in chat history.