Start a conversation

How to keep the chat session alive

QBChat instance has 90 seconds timeout. After a timeout the socket is closing. You need to keep up the connection by sending the (BOOL)sendPresence message to QBChat instance object. This will support the chat workflow. It is better to do this via timer. For example:

self.presenceTimer=[NSTimer scheduledTimerWithTimeInterval:30 target:[QBChat instance]
selector:@selector(sendPresence) userInfo:nil repeats:YES];

This way you show that user is online, can send and receive messages.

Choose files or drag and drop files
Was this article helpful?
Yes
No
  1. Maksym Pidhorbunskyi

  2. Posted
  3. Updated

Comments