在您提供的鏈接中有read和delivered狀態的文檔。
爲了使這個答案更加明確,有幾種方法可以將消息標記爲已讀和已發送。已交付標誌着只有XMPP的方式提供,使用這種方法從QBChat做到這一點:
/**
Mark messages as read.
@note Updates message "read" status only on server.
@param dialogID dialog ID.
@param messagesIDs Set of chat message IDs to mark as read. If messageIDs is nil then all messages in dialog will be marked as read.
@param successBlock Block with response instance if request succeded.
@param errorBlock Block with response instance if request failed.
@return An instance, which conforms Cancelable protocol. Use this instance to cancel the operation.
*/
+ (QB_NONNULL QBRequest *)markMessagesAsRead:(QB_NONNULL NSSet QB_GENERIC(NSString *) *)messagesIDs
dialogID:(QB_NONNULL NSString *)dialogID
successBlock:(QB_NULLABLE void(^)(QBResponse * QB_NONNULL_S response))successBlock
errorBlock:(QB_NULLABLE QBRequestErrorBlock)errorBlock;
或XMPP的方法:
/**
* Send "delivered" status for message.
*
* @param message QBChatMessage message to mark as delivered.
* @param completion Completion block with failure error.
*/
- (void)markAsDelivered:(QB_NONNULL QBChatMessage *)message completion:(QB_NULLABLE QBChatCompletionBlock)completion;
對於讀取標記,你可以使用QBRequest方法請使用REST請求QBChat:
/**
* Send "read" status for message and update "read" status on a server
*
* @param message QBChatMessage message to mark as read.
* @param completion Completion block with failure error.
*/
- (void)readMessage:(QB_NONNULL QBChatMessage *)message completion:(QB_NULLABLE QBChatCompletionBlock)completion;
無論如何,如果您需要一個「實時」示例,請仔細閱讀樣本和文檔。
Quickblox已經提供狀態讀取和未讀狀態 –
沒有這樣的代碼實現,我試圖實現,但它不工作 –