Hello,
When fetching all messages for a logged in user, the API returns an empty array. I have been sending messages successfully, I can see the messages in the Comet Chat dashboard. When I try and get all the messages for a user I just get an empty array.
Please note, the “getConversations” api is working fine for me.
Im using:
“@cometchat-pro/react-native-calls”: “2.0.2”,
“@cometchat-pro/react-native-chat”: “2.3.4”,
var limit = 50;
var messagesRequest = new CometChat.MessagesRequestBuilder()
.setLimit(limit)
.build();
messagesRequest.fetchPrevious().then(
messages => {
console.log("Message list fetched:", messages);
// Handle the list of messages
},
error => {
console.log("Message fetching failed with error:", error);
}
);