ConnectyCube / connectycube-reactnative-samples

Chat and Video Chat code samples for React Native, ConnectyCube
https://connectycube.com
Apache License 2.0
124 stars 111 forks source link

Having issues with sent and delivered status listener #276

Closed UmerQur3shi closed 2 years ago

UmerQur3shi commented 2 years ago

Hey, It returns the message on sent message callback but there is no property for the message that tells that the message is sent or delivered. Does ConnectyCube provide anything with which we don't have to check all the messages in the list one by one whether they are delivered/sent or not? For example, a property in the message object like sent:true or delivered:true ? because I want to display the status of every message right infront of it. Help will be appreciated, thanks.

ccvlad commented 2 years ago

@UmerQur3shi we have the info in our docs. Please read the js docs first:

ccvlad commented 2 years ago

Also if you get messages' history via REST API - https://developers.connectycube.com/js/messaging?id=chat-history

https://developers.connectycube.com/server/chat?id=response-11

message.delivered_ids - array with users ids who were received the message message.read_ids - array with users ids who were read the message

UmerQur3shi commented 2 years ago

@UmerQur3shi we have the info in our docs. Please read the js docs first:

Thanks for the reply, I've already read the docs, it's given in the docs ConnectyCube.chat.onSentMessageCallback = function (messageLost, messageSent) {}; The "messageSent" object gives the message which is sent with message id, but there is no send_state property for the message object when I retrieve messages for a dialog from connectycube. How can I show sent mark at the end of my every message in a dialog, is there anything like any property in the API or I have to do that manually with extra code and processing by adding another property with each message object in the array retrieved from ConnectyCube which tells that the message is sent?

UmerQur3shi commented 2 years ago

In

@UmerQur3shi we have the info in our docs. Please read the js docs first:

In simple words, when I fetch all the messages for a dialog from ConnectyCube, how would I know the status of all the messages if there won't be any property like "delivered" which tells that the message was delivered?

ccvlad commented 2 years ago

In

@UmerQur3shi we have the info in our docs. Please read the js docs first:

In simple words, when I fetch all the messages for a dialog from ConnectyCube, how would I know the status of all the messages if there won't be any property like "delivered" which tells that the message was delivered?

https://github.com/ConnectyCube/connectycube-reactnative-samples/issues/276#issuecomment-952979492

ccvlad commented 2 years ago

@UmerQur3shi we have the info in our docs. Please read the js docs first:

Thanks for the reply, I've already read the docs, it's given in the docs ConnectyCube.chat.onSentMessageCallback = function (messageLost, messageSent) {}; The "messageSent" object gives the message which is sent with message id, but there is no send_state property for the message object when I retrieve messages for a dialog from connectycube. How can I show sent mark at the end of my every message in a dialog, is there anything like any property in the API or I have to do that manually with extra code and processing by adding another property with each message object in the array retrieved from ConnectyCube which tells that the message is sent?

messageSent - the message was sent successful and chat server has received it (the same with status "sent") messageLost - the message was failed (the same with status "failed")

UmerQur3shi commented 2 years ago

And what about timestamp, is there any server timestamp like two persons in a chat are from different countries, their time will also be different, will I get the message time according to their timezone or will it be same for both of them?