What's the more efficient way to build whatsapp-like chat functionalities with Quickblox, in particular these behaviors:
So far, I'm inclined to a solution like this:
For someone familiarized with Quickblox, does this look correct or is there a better way to achieve the same behavior?
1) use chat rooms for 1:1 chat for the history functionality
2) register each 1:1 chat room in Custom Objects at the time of creation with meta information including a dateOfLastReceivedMessage field (1 extra call to QB for each user)
3) every time chatRoomDidReceiveMessage is called, update the date of dateOfLastReceivedMessage field (2 extra calls to QB; search the record and update it)
You can use 1-1 Chat (not chat room) and also have Chat history, QuickBlox released plugin for this http://quickblox.com/developers/Chat/1:1_Chat_history
All Chat history will be stored in CustomObjects module. You will be able to use great search API to request chat history
with every message sent, also send a push notification (1 extra call to QB)
Correct
every time didReceivedRemoteNotification is called, compare the date of the message (a) with dateOfLastReceivedMessage in Custom Objects (b) (1 extra call to QB): if a > b -> notification is a new/unread message: increment counter of new messages and show a visual clue/play a sound. if a > b -> notification is not a new/unread message: do nothing.
Yes, should work this way