Вопрос

I would like to have my QBchat automatically be logged back in if it is disconnected. When I attempt to send a message and I am logged out, is their a callback function that I can implement to test if I am logged out? Also, if I am correct we must have a session establish with QB, than we log into our QBUUSER, than we must log into our QBChat to send messages? How can reconnect all of these pieces if I lose connection.

Это было полезно?

Решение

In case of logout this method will be called

- (void)chatDidFailWithError:(int)code;

where code will be 0

Другие советы

ChatDidFailWithError is a QBChat delegate method and checks for an active chat instance. If the chat has indeed failed auto-login with the user credentials saved in the DataManager singleton. (Example of which is in the QuickBlox framework's documentation)

  • (void)chatDidFailWithError:(NSInteger)code { // recall user credentials from singleton class DataManager [[QBChat instance] loginWithUser:[DataManager shared].currentUser]; }
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top