Search code examples
iosquickblox

Issue in receiving offline messages with QuickBlox


I'm working on a app which supports private chat via QuickBlox iOS SDK. Everything working fine, except this scene, suppose we've two users, UserA and UserB. Both can able to receive messages if they successfully logged in into QBChat. Now UserB went to background from app (I've explicitly logged him out from the chat). Here, UserA sends a message "You're offline! And yeah, you'll never get this message because there's a possible bug in QuickBlox." Again, UserB back to the app (and I'll make him login in again in QBChat), but strangely he'll not receive that message, however its on application dashboard in QuickBlox page. Again, its also showing that message as lastMessageText of QBChatDialog object. Now the real horror scene will come, again UserB went to background, if UserA sends messages like, A, B, C, D, E. When he'll come back to the app, UserB would only receive B, C, D, E. And not the A which was the first message in queue. And yes, its also on application dashboard and also updated for QBChatDialog object.

What's wrong?


Solution

  • This is still an issue, but I'm able to resolve it by setting a property.

    Set, [QBSettings useTLSForChat:YES]; once you make request to sign-in into QBChat.

    However the main reason of this issue is when user A will be going offline and at the same moment user B will send messages M1, M2, M3 ... then, A will only get M2 and M3 ... But if user B will sends him messages few seconds after that user A logout from QBChat, then A will get all three messages.

    Update:

    From Quickblox iOS SDK 2.3, they made YES (by default) for [QBSettings useTLSForChat:YES]; so we don't need to explicitly set this.