I'm using QuickBlox iOS SDK to have chat functionality into my app. It works great. Now there's a requirement from client to manage badge counter for each of the push notifications.
There's some scenarios which may help you to suggest me the flow to handle badge counter:
So in 1st and 3rd cases, push notifications will send from the code it self. And 2nd approach will get done by the QuickBlox server for the user who's currently offline. How to handle 4th and 5th cases too.
Please let me suggest the correct approach to handle badge counting for these cases.
At the moment in order to know all unread messages number you need to request dialogs
+ (QBRequest *)dialogsForPage:(QBResponsePage *)page extendedRequest:(NSDictionary *)extendedRequest
successBlock:(void(^)(QBResponse *response, NSArray *dialogObjects, NSSet *dialogsUsersIDs, QBResponsePage *page))successBlock
errorBlock:(QBRequestErrorBlock)errorBlock
And for all dialogs count unread_messages_count
In future releases we are planing to add a method such as
[QBRequest unreadMessagesCount:successBlock:errorBlock]
Will it be suitable for your purposes?