chat-sdk / chat-sdk-ios

Chat SDK iOS - Open Source Mobile Messenger
http://sdk.chat
Other
913 stars 276 forks source link

iOS chat SDK set message read inside thread #490

Closed ahmadrushdie closed 2 years ago

ahmadrushdie commented 2 years ago

for Android we have ChatSDK.readReceipts().markRead(msg) but for iOS we have BChatSDK.readReceipt()?.markRead(thread)

is there any way to make spesific message read in iOS

bensmiley commented 2 years ago

You can do it like this:

-(RXPromise *) markMessageRead: (id<PMessage>) message {
    CCMessageWrapper * wrapper = [FirebaseNetworkAdapterModule.shared.firebaseProvider messageWrapperWithModel:message];
    return [wrapper setReadStatus: bMessageReadStatusRead];
}

or:

-(RXPromise *) markMessageRead: (id<PMessage>) message {
    CCMessageWrapper * wrapper = [CCMessageWrapper messageWithModel:message];
    return [wrapper setReadStatus: bMessageReadStatusRead];
}

Depending on your Chat SDK version.

ahmadrushdie commented 2 years ago

@bensmiley can you please provide me from where i can use the two methods ?

bensmiley commented 2 years ago

Just copy paste them into your code... They will work anywhere.

ahmadrushdie commented 2 years ago

@bensmiley i think we need to buy the READ RECEIPTS module in order to mark messages read by users ?

bensmiley commented 2 years ago

Yes, when you have that module you can use this method.