[英]How to manage badge counter for push notification from QuickBlox?
I'm using QuickBlox iOS SDK to have chat functionality into my app. 我正在使用QuickBlox iOS SDK将聊天功能集成到我的应用中。 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.
第二种方法将由QuickBlox服务器为当前离线的用户完成。 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 对于所有对话框,计数为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? 是否适合您的目的?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.